Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/pipelines_controller.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 10a6d2d3f26..477ba36e9d1 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -199,12 +199,7 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def latest_pipeline
- ref = params['ref'].presence || @project.default_branch
- sha = @project.commit(ref)&.sha
-
- @project.ci_pipelines
- .newest_first(ref: ref, sha: sha)
- .first
+ @project.latest_pipeline_for_ref(params['ref'])
&.present(current_user: current_user)
end