diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-11-17 12:56:12 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-11-17 12:56:12 +0000 |
commit | 6d36c3b5de7772415b1176b8247c34053b826a74 (patch) | |
tree | 5b7f1d8113bb0ad19916732be9b0a2c7081be09f /app/controllers | |
parent | 69dd59aec9e5f8959fa36eb74db28d71aad4212b (diff) | |
parent | ab16a6fb34c0f3e4d9afed3332c559868201e606 (diff) | |
download | gitlab-ce-6d36c3b5de7772415b1176b8247c34053b826a74.tar.gz |
Merge branch 'ci-pipeline-status-query' into 'master'
Optimise getting the pipeline status of commits
See merge request gitlab-org/gitlab-ce!15332
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/commits_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index 28920877635..5f4afd2cdee 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -57,6 +57,7 @@ class Projects::CommitsController < Projects::ApplicationController @repository.commits(@ref, path: @path, limit: @limit, offset: @offset) end + @commits = @commits.with_pipeline_status @commits = prepare_commits_for_rendering(@commits) end end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 22de6680511..abe4e5245b1 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -80,7 +80,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo def commits # Get commits from repository # or from cache if already merged - @commits = prepare_commits_for_rendering(@merge_request.commits) + @commits = + prepare_commits_for_rendering(@merge_request.commits.with_pipeline_status) render json: { html: view_to_html_string('projects/merge_requests/_commits') } end |