summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-19 15:36:57 +0000
committerRémy Coutable <remy@rymai.me>2016-09-19 15:36:57 +0000
commitb4434a36820a5e445067bc71341e882eecdc5c1f (patch)
treed33eb35e016bc444863eb47e47d2a277d7446e1c /app
parent9335953d12a9c72a3de7bb6ed48bcbeb9ff0357f (diff)
parentb1a4d94091b87ca0a8d36a7b75095f7ae5d7ccef (diff)
downloadgitlab-ce-b4434a36820a5e445067bc71341e882eecdc5c1f.tar.gz
Merge branch 'sh-prevent-duplicate-protected-branches-on-push' into 'master'
Only create a protected branch upon a push to a new branch if a rule for that branch doesn't exist A customer ran into an issue where a Sidekiq task retried over and over, leading to duplicate master branches in their protected branch list. Closes #22177 See merge request !6399
Diffstat (limited to 'app')
-rw-r--r--app/services/git_push_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 78feb37aa2a..948041063c0 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -87,7 +87,7 @@ class GitPushService < BaseService
project.change_head(branch_name)
# Set protection on the default branch if configured
- if current_application_settings.default_branch_protection != PROTECTION_NONE
+ if current_application_settings.default_branch_protection != PROTECTION_NONE && !@project.protected_branch?(@project.default_branch)
params = {
name: @project.default_branch,