diff options
author | Mathias Vestergaard <mathias.vestergaard@gmail.com> | 2016-05-20 02:58:34 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-13 10:54:26 +0300 |
commit | f0577d838544152f558411ef1101d56c5852d92e (patch) | |
tree | 5c2a60db094b4cf570e90bd97db0219cdd353ef5 /app/services | |
parent | ecd301ddf618488a2b54827b44f9017f89b3d27d (diff) |
Added "developers can merge" setting to protected branches
- Cherry-picked from `mvestergaard:branch-protection-dev-merge`
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4220
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/git_push_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index a886f35981f..e02b50ff9a2 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -89,7 +89,8 @@ class GitPushService < BaseService # Set protection on the default branch if configured if current_application_settings.default_branch_protection != PROTECTION_NONE developers_can_push = current_application_settings.default_branch_protection == PROTECTION_DEV_CAN_PUSH ? true : false - @project.protected_branches.create({ name: @project.default_branch, developers_can_push: developers_can_push }) + developers_can_merge = current_application_settings.default_branch_protection == PROTECTION_DEV_CAN_MERGE ? true : false + @project.protected_branches.create({ name: @project.default_branch, developers_can_push: developers_can_push, developers_can_merge: developers_can_merge }) end end |