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:
authorStan Hu <stanhu@gmail.com>2016-09-18 06:33:41 +0300
committerStan Hu <stanhu@gmail.com>2016-09-18 06:36:07 +0300
commitb1a4d94091b87ca0a8d36a7b75095f7ae5d7ccef (patch)
tree8642cbc596d6c2437e6ad259fb321b17f26bdb24 /app/services/git_push_service.rb
parentd38499b3a785ea9d15cb3f108764d20016ea8ea7 (diff)
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
Diffstat (limited to 'app/services/git_push_service.rb')
-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,