diff options
author | Toon Claes <toon@iotcl.com> | 2017-11-07 16:49:07 +0100 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-11-07 16:58:36 +0100 |
commit | ca3c86856722ec94c30669cb1fa684c68ff80930 (patch) | |
tree | a42e64dcb0783ddd38dae53bfbd21b1b8420a196 /spec/services | |
parent | dc1e6b436268c00bd1fdf3d15597a4656e029b95 (diff) | |
download | gitlab-ce-ca3c86856722ec94c30669cb1fa684c68ff80930.tar.gz |
When deleting merged branches, ignore protected tagstc-delete-merged-protected-tags-fix
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 'spec/services')
-rw-r--r-- | spec/services/delete_merged_branches_service_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/delete_merged_branches_service_spec.rb b/spec/services/delete_merged_branches_service_spec.rb index 5a9eb359ee1..0de02576203 100644 --- a/spec/services/delete_merged_branches_service_spec.rb +++ b/spec/services/delete_merged_branches_service_spec.rb @@ -42,6 +42,14 @@ describe DeleteMergedBranchesService do expect(project.repository.branch_names).to include('improve/awesome') end + it 'ignores protected tags' do + create(:protected_tag, project: project, name: 'improve/*') + + service.execute + + expect(project.repository.branch_names).not_to include('improve/awesome') + end + context 'user without rights' do let(:user) { create(:user) } |