diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-25 17:59:05 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-25 18:04:15 +0300 |
commit | 9776dbda4f6d8f0f7e9a32185cc0d493f9fe3c02 (patch) | |
tree | e8c2096da465e6323e5ba07f00398a55ed26ec1d /app/services/ci | |
parent | 8f47d484dab12df982655c3c05305bce7624914d (diff) |
Use tag/branch methods to check if pipeline ref exists
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 6 |
1 files changed, 3 insertions, 3 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 |