summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-25 16:59:05 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-25 17:04:15 +0200
commit9776dbda4f6d8f0f7e9a32185cc0d493f9fe3c02 (patch)
treee8c2096da465e6323e5ba07f00398a55ed26ec1d /lib
parent8f47d484dab12df982655c3c05305bce7624914d (diff)
downloadgitlab-ce-9776dbda4f6d8f0f7e9a32185cc0d493f9fe3c02.tar.gz
Use tag/branch methods to check if pipeline ref exists
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/pipeline/chain/validate.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/validate.rb b/lib/gitlab/ci/pipeline/chain/validate.rb
index e7109425d6c..4c4c8b27be6 100644
--- a/lib/gitlab/ci/pipeline/chain/validate.rb
+++ b/lib/gitlab/ci/pipeline/chain/validate.rb
@@ -79,22 +79,16 @@ module Gitlab
end
end
- ## TODO, move to Pipeline as `branch_exists?`
- #
def branch?
return @is_branch if defined?(@is_branch)
- @is_branch = project.repository
- .ref_exists?(Gitlab::Git::BRANCH_REF_PREFIX + pipeline.ref)
+ @is_branch = project.repository.branch_exists?(pipeline.ref)
end
- ## TODO, move to pipeline as `tag_exists?`
- #
def tag?
return @is_tag if defined?(@is_tag)
- @is_tag = project.repository
- .ref_exists?(Gitlab::Git::TAG_REF_PREFIX + pipeline.ref)
+ @is_tag = project.repository.tag_exists?(pipeline.ref)
end
def error(message)