diff options
author | Stan Hu <stanhu@gmail.com> | 2016-09-18 06:33:41 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-09-18 06:36:07 +0300 |
commit | b1a4d94091b87ca0a8d36a7b75095f7ae5d7ccef (patch) | |
tree | 8642cbc596d6c2437e6ad259fb321b17f26bdb24 /app | |
parent | d38499b3a785ea9d15cb3f108764d20016ea8ea7 (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')
-rw-r--r-- | app/services/git_push_service.rb | 2 |
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, |