summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-11-23 00:11:42 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-12-08 19:28:56 +0100
commit350ea9c55ab6b980ac5ec74d2a34b9cbac915e20 (patch)
tree0f5bb6e6adac068f25ed063d86c6f013ea1cd9ee /lib
parentd307dccbc60f088496fb727f40530ba3003b61fb (diff)
downloadgitlab-ce-350ea9c55ab6b980ac5ec74d2a34b9cbac915e20.tar.gz
Implement Repository#ambiguous_ref?
This implements Repository#ambiguous_ref? and checks if a ref is ambiguous before trying to resolve the ref in Project#protected_for?
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/pipeline/chain/validate/repository.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/validate/repository.rb b/lib/gitlab/ci/pipeline/chain/validate/repository.rb
index 6e95c0717c6..09b3187569c 100644
--- a/lib/gitlab/ci/pipeline/chain/validate/repository.rb
+++ b/lib/gitlab/ci/pipeline/chain/validate/repository.rb
@@ -17,7 +17,7 @@ module Gitlab
return error('Commit not found')
end
- unless @command.project.repository.resolve_ref(@command.origin_ref)
+ if @command.project.repository.ambiguous_ref?(@command.origin_ref)
return error('Ref is ambiguous')
end
end