Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2017-11-07 18:49:07 +0300
committerToon Claes <toon@iotcl.com>2017-11-07 18:58:36 +0300
commitca3c86856722ec94c30669cb1fa684c68ff80930 (patch)
treea42e64dcb0783ddd38dae53bfbd21b1b8420a196 /app/services
parentdc1e6b436268c00bd1fdf3d15597a4656e029b95 (diff)
When deleting merged branches, ignore protected tags
In gitlab-org/gitlab-ce!13251 wildcard Protected Branches were handled properly when deleting all merged branches. But this fix wasn't that good. It also checked branch names against Protected Tags. That's not correct. This change will **only** check if there is a Protected Branch matching the merged branch, and ignores Protected Tags. Closes gitlab-org/gitlab-ce#39732.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/delete_merged_branches_service.rb2
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 077268b2388..cb235a85daf 100644
--- a/app/services/delete_merged_branches_service.rb
+++ b/app/services/delete_merged_branches_service.rb
@@ -13,7 +13,7 @@ class DeleteMergedBranchesService < BaseService
# Prevent deletion of branches relevant to open merge requests
branches -= merge_request_branch_names
# Prevent deletion of protected branches
- branches = branches.reject { |branch| project.protected_for?(branch) }
+ branches = branches.reject { |branch| ProtectedBranch.protected?(project, branch) }
branches.each do |branch|
DeleteBranchService.new(project, current_user).execute(branch)