diff options
Diffstat (limited to 'app/presenters/ci/build_runner_presenter.rb')
-rw-r--r-- | app/presenters/ci/build_runner_presenter.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb index 5231a8efa55..8e469795581 100644 --- a/app/presenters/ci/build_runner_presenter.rb +++ b/app/presenters/ci/build_runner_presenter.rb @@ -34,7 +34,8 @@ module Ci def refspecs specs = [] - specs << refspec_for_merge_request_ref if merge_request_ref? + specs << refspec_for_pipeline_ref if merge_request_ref? + specs << refspec_for_persistent_ref if persistent_ref_exist? if git_depth > 0 specs << refspec_for_branch(ref) if branch? || legacy_detached_merge_request_pipeline? @@ -86,10 +87,22 @@ module Ci "+#{Gitlab::Git::TAG_REF_PREFIX}#{ref}:#{RUNNER_REMOTE_TAG_PREFIX}#{ref}" end - def refspec_for_merge_request_ref + def refspec_for_pipeline_ref "+#{ref}:#{ref}" end + def refspec_for_persistent_ref + "+#{persistent_ref_path}:#{persistent_ref_path}" + end + + def persistent_ref_exist? + pipeline.persistent_ref.exist? + end + + def persistent_ref_path + pipeline.persistent_ref.path + end + def git_depth_variable strong_memoize(:git_depth_variable) do variables&.find { |variable| variable[:key] == 'GIT_DEPTH' } |