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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-17 15:06:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-17 15:06:48 +0300
commitbd860c22f6a4b9473cbddd34a53eead8235a7ea1 (patch)
tree3f955a56c2ac90497863da26902a42dba49f3466 /app/controllers
parente567b4c2df7dc4085d213db029eff6b6fcde0152 (diff)
Add latest changes from gitlab-org/gitlab@master
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