diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-11-26 15:43:46 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-12-08 19:28:56 +0100 |
commit | a1be58097943f7f568de6a90aa12cf7452ac2f0a (patch) | |
tree | 00bb9628462db4690b6898b1c0e1fb528ee3722a /lib | |
parent | 9f6d228d2368911befc11038d64ccb9ccae131ad (diff) | |
download | gitlab-ce-a1be58097943f7f568de6a90aa12cf7452ac2f0a.tar.gz |
Implement Command#ambiguous_ref?
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/command.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/validate/repository.rb | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/command.rb b/lib/gitlab/ci/pipeline/chain/command.rb index 316c283d90b..90208352c55 100644 --- a/lib/gitlab/ci/pipeline/chain/command.rb +++ b/lib/gitlab/ci/pipeline/chain/command.rb @@ -57,6 +57,12 @@ module Gitlab project.protected_for?(origin_ref) end end + + def ambiguous_ref? + strong_memoize(:ambiguous_ref) do + project.repository.ambiguous_ref?(origin_ref) + end + end end end end diff --git a/lib/gitlab/ci/pipeline/chain/validate/repository.rb b/lib/gitlab/ci/pipeline/chain/validate/repository.rb index 09b3187569c..9c6c2bc8e25 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 - if @command.project.repository.ambiguous_ref?(@command.origin_ref) + if @command.ambiguous_ref? return error('Ref is ambiguous') end end |