diff options
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r-- | app/controllers/projects/branches_controller.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 9124728ee25..cf1efda5d13 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -27,7 +27,7 @@ class Projects::BranchesController < Projects::ApplicationController @refs_pipelines = @project.ci_pipelines.latest_successful_for_refs(@branches.map(&:name)) @merged_branch_names = repository.merged_branch_names(@branches.map(&:name)) - @branch_pipeline_statuses = branch_pipeline_statuses + @branch_pipeline_statuses = Ci::CommitStatusesFinder.new(@project, repository, current_user, @branches).execute # https://gitlab.com/gitlab-org/gitlab/-/issues/22851 Gitlab::GitalyClient.allow_n_plus_1_calls do @@ -197,15 +197,4 @@ class Projects::BranchesController < Projects::ApplicationController confidential_issue_project end - - def branch_pipeline_statuses - latest_commits = @branches.map do |branch| - [branch.name, repository.commit(branch.dereferenced_target).sha] - end.to_h - - latest_pipelines = project.ci_pipelines.latest_pipeline_per_commit(latest_commits.values) - latest_commits.transform_values do |commit_sha| - latest_pipelines[commit_sha]&.detailed_status(current_user) - end.compact - end end |