summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/services/ci/create_pipeline_service.rb6
-rw-r--r--lib/gitlab/ci/pipeline/chain/validate.rb10
2 files changed, 5 insertions, 11 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 1a5bf7142e0..f96c4741ba4 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -107,8 +107,7 @@ module Ci
def tag?
return @is_tag if defined?(@is_tag)
- @is_tag =
- project.repository.ref_exists?(Gitlab::Git::TAG_REF_PREFIX + ref)
+ @is_tag = project.repository.tag_exists?(ref)
end
def ref
@@ -120,7 +119,8 @@ module Ci
end
def pipeline_created_counter
- @pipeline_created_counter ||= Gitlab::Metrics.counter(:pipelines_created_total, "Counter of pipelines created")
+ @pipeline_created_counter ||= Gitlab::Metrics
+ .counter(:pipelines_created_total, "Counter of pipelines created")
end
end
end
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)