diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 02f37135670..da09f245b48 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1587,8 +1587,11 @@ class Project < ActiveRecord::Base end def protected_for?(ref) - ProtectedBranch.protected?(self, ref) || + if repository.branch_exists?(ref) + ProtectedBranch.protected?(self, ref) + elsif repository.tag_exists?(ref) ProtectedTag.protected?(self, ref) + end end def deployment_variables |