summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-11-16 13:20:52 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-12-08 19:28:55 +0100
commit38348aa1215daa2393b7d488c1ca8926d67dc09e (patch)
tree6514a61b774ffd4a150e605853b50275cb7aa88e /app/models/project.rb
parent2b4883e05e59eff08088e378bf3061d9d8da13dd (diff)
downloadgitlab-ce-38348aa1215daa2393b7d488c1ca8926d67dc09e.tar.gz
Remove Gitlab::Git::Ref#full_ref
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index e1acfbe7770..22ce916a36c 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1755,13 +1755,11 @@ class Project < ActiveRecord::Base
resolved_ref = resolve_ref(ref)
return false unless resolved_ref
- full_ref = resolved_ref.full_ref
- ref_name = resolved_ref.name
-
- if Gitlab::Git.branch_ref?(full_ref)
- ProtectedBranch.protected?(self, ref_name)
- elsif Gitlab::Git.tag_ref?(full_ref)
- ProtectedTag.protected?(self, ref_name)
+ case resolved_ref
+ when Gitlab::Git::Branch
+ ProtectedBranch.protected?(self, resolved_ref.name)
+ when Gitlab::Git::Tag
+ ProtectedTag.protected?(self, resolved_ref.name)
end
end