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-30 18:08:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-30 18:08:09 +0300
commit538fff823de57d1ba5317961aa43091de9dc007f (patch)
treec741665b338cc0d51ce5f73f5671e5eee8e69349 /app/models/commit_collection.rb
parent3692e9f8a23386c627942ca2a9edd8c00af7e904 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/commit_collection.rb')
-rw-r--r--app/models/commit_collection.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/models/commit_collection.rb b/app/models/commit_collection.rb
index e8df46e1cc3..6b303c52283 100644
--- a/app/models/commit_collection.rb
+++ b/app/models/commit_collection.rb
@@ -34,6 +34,20 @@ class CommitCollection
end
end
+ # Returns the collection with the latest pipeline for every commit pre-set.
+ #
+ # Setting the pipeline for each commit ahead of time removes the need for running
+ # a query for every commit we're displaying.
+ def with_latest_pipeline(ref = nil)
+ pipelines = project.ci_pipelines.latest_pipeline_per_commit(map(&:id), ref)
+
+ each do |commit|
+ commit.set_latest_pipeline_for_ref(ref, pipelines[commit.id])
+ end
+
+ self
+ end
+
def unenriched
commits.reject(&:gitaly_commit?)
end
@@ -65,20 +79,6 @@ class CommitCollection
self
end
- # Sets the pipeline status for every commit.
- #
- # Setting this status ahead of time removes the need for running a query for
- # every commit we're displaying.
- def with_pipeline_status
- statuses = project.ci_pipelines.latest_status_per_commit(map(&:id), ref)
-
- each do |commit|
- commit.set_status_for_ref(ref, statuses[commit.id])
- end
-
- self
- end
-
def respond_to_missing?(message, inc_private = false)
commits.respond_to?(message, inc_private)
end