diff options
Diffstat (limited to 'app/models/protected_branch.rb')
-rw-r--r-- | app/models/protected_branch.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb index 76c277e4b86..b3a918d8952 100644 --- a/app/models/protected_branch.rb +++ b/app/models/protected_branch.rb @@ -25,10 +25,12 @@ class ProtectedBranch < ApplicationRecord end # Check if branch name is marked as protected in the system - def self.protected?(project, ref_name, dry_run: true) + def self.protected?(project, ref_name) return true if project.empty_repo? && project.default_branch_protected? return false if ref_name.blank? + dry_run = Feature.disabled?(:rely_on_protected_branches_cache, project) + new_cache_result = new_cache(project, ref_name, dry_run: dry_run) return new_cache_result unless new_cache_result.nil? |