diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/models/protected_branch.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
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? |