summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-11-28 15:43:58 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-12-08 19:28:57 +0100
commit08942de9b6a3ad361cbae8a83a8e8b7c7e4768ec (patch)
treec9dd1e2984386fcb6a963c1ac8bebd4f5c5abad9 /app/models/project.rb
parentdfe7f57eef0c5c2319c5c9898ba0721b6a1c9913 (diff)
downloadgitlab-ce-08942de9b6a3ad361cbae8a83a8e8b7c7e4768ec.tar.gz
Raise an error on ambiguous refs
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index a8bef70f505..9a9ef5c2fa9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1737,7 +1737,8 @@ class Project < ActiveRecord::Base
end
def protected_for?(ref)
- return false if ref.nil? || repository.ambiguous_ref?(ref)
+ return false if ref.nil?
+ raise Repository::AmbiguousRefError if repository.ambiguous_ref?(ref)
if Gitlab::Git.branch_ref?(ref) || Gitlab::Git.tag_ref?(ref)
resolved_ref = ref