diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-07-19 11:33:47 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-07-19 11:33:47 +0200 |
commit | 3e281f95907686ba4a923b8825dc32afb22df038 (patch) | |
tree | 05bd52da829d210973cfbd80d79ab724c4fea0ba /lib | |
parent | e552b4af26b68a8b4bedc775a128a8ecd59ff689 (diff) | |
download | gitlab-ce-3e281f95907686ba4a923b8825dc32afb22df038.tar.gz |
Only update once
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/branches.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb index b77eebc729a..35efe4f2e4a 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -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, |