diff options
Diffstat (limited to 'lib/gitlab/checks/branch_check.rb')
-rw-r--r-- | lib/gitlab/checks/branch_check.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/checks/branch_check.rb b/lib/gitlab/checks/branch_check.rb index ad2a718ef67..a8287a97cc3 100644 --- a/lib/gitlab/checks/branch_check.rb +++ b/lib/gitlab/checks/branch_check.rb @@ -51,7 +51,7 @@ module Gitlab logger.log_timed(LOG_MESSAGES[:protected_branch_checks]) do return unless ProtectedBranch.protected?(project, branch_name) # rubocop:disable Cop/AvoidReturnFromBlocks - if forced_push? + if forced_push? && !ProtectedBranch.allow_force_push?(project, branch_name) raise GitAccess::ForbiddenError, ERROR_MESSAGES[:force_push_protected_branch] end end |