From bd860c22f6a4b9473cbddd34a53eead8235a7ea1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 17 Sep 2019 12:06:48 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/projects/pipelines_controller.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'app/controllers') 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 -- cgit v1.2.3