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:
Diffstat (limited to 'app/models/protected_tag.rb')
-rw-r--r--app/models/protected_tag.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/protected_tag.rb b/app/models/protected_tag.rb
index 6b507429e57..5b2467daddc 100644
--- a/app/models/protected_tag.rb
+++ b/app/models/protected_tag.rb
@@ -8,7 +8,11 @@ class ProtectedTag < ApplicationRecord
protected_ref_access_levels :create
def self.protected?(project, ref_name)
- refs = project.protected_tags.select(:name)
+ return false if ref_name.blank?
+
+ refs = Gitlab::SafeRequestStore.fetch("protected-tag:#{project.cache_key}:refs") do
+ project.protected_tags.select(:name)
+ end
self.matching(ref_name, protected_refs: refs).present?
end