Only update once
This commit is contained in:
parent
e552b4af26
commit
3e281f9590
1 changed files with 3 additions and 2 deletions
|
@ -51,8 +51,9 @@ module API
|
|||
developers_can_merge = to_boolean(params[:developers_can_merge])
|
||||
|
||||
if protected_branch
|
||||
protected_branch.update(developers_can_push: developers_can_push) unless developers_can_push.nil?
|
||||
protected_branch.update(developers_can_merge: developers_can_merge) unless developers_can_merge.nil?
|
||||
protected_branch.developers_can_push = developers_can_push unless developers_can_push.nil?
|
||||
protected_branch.developers_can_merge = developers_can_merge unless developers_can_merge.nil?
|
||||
protected_branch.save
|
||||
else
|
||||
user_project.protected_branches.create(name: @branch.name,
|
||||
developers_can_push: developers_can_push || false,
|
||||
|
|
Loading…
Reference in a new issue