diff options
author | Toon Claes <toon@iotcl.com> | 2017-08-02 14:40:17 +0200 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-08-02 14:45:54 +0200 |
commit | 35081a77b0527e606c0835a979403ec4d55564d5 (patch) | |
tree | e3d5841cf0f0f8807b659e055ca9f618016f28a9 /app | |
parent | 1b117e7f2d8cf4c2793bd2234688ad8739056894 (diff) | |
download | gitlab-ce-35081a77b0527e606c0835a979403ec4d55564d5.tar.gz |
Make Delete Merged Branches handle wildcard protected branches correctly
The "Delete Merged Branches" button should filter out protected
branches matching the wildcard patterns.
Closes gitlab-org/gitlab-ce#35592.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/delete_merged_branches_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/delete_merged_branches_service.rb b/app/services/delete_merged_branches_service.rb index 5c9e2a16c71..ff11bd59d29 100644 --- a/app/services/delete_merged_branches_service.rb +++ b/app/services/delete_merged_branches_service.rb @@ -11,7 +11,7 @@ class DeleteMergedBranchesService < BaseService # Prevent deletion of branches relevant to open merge requests branches -= merge_request_branch_names # Prevent deletion of protected branches - branches -= project.protected_branches.pluck(:name) + branches = branches.reject { |branch| project.protected_for?(branch) } branches.each do |branch| DeleteBranchService.new(project, current_user).execute(branch) |