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:
authorAdam Niedzielski <adamsunday@gmail.com>2016-12-01 14:17:30 +0300
committerAdam Niedzielski <adamsunday@gmail.com>2016-12-01 14:17:30 +0300
commitcb6f8cdfc23a18daf33288c95ae8badec63f53ad (patch)
treecad717c7ba416e3fc7974c833cff154d3a1449a2 /app/services/merge_requests
parent2adc6568a6f94b2844c95a0b699a0be9bb8980d1 (diff)
Replace references to MergeRequestDiff#commits with st_commits
when we care only about the number of commits We do not have to instantiate all objects in this case.
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r--app/services/merge_requests/refresh_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb
index 22596b4014a..e4056306bc4 100644
--- a/app/services/merge_requests/refresh_service.rb
+++ b/app/services/merge_requests/refresh_service.rb
@@ -63,7 +63,7 @@ module MergeRequests
if merge_request.source_branch == @branch_name || force_push?
merge_request.reload_diff
else
- mr_commit_ids = merge_request.commits.map(&:id)
+ mr_commit_ids = merge_request.commits_sha
push_commit_ids = @commits.map(&:id)
matches = mr_commit_ids & push_commit_ids
merge_request.reload_diff if matches.any?
@@ -123,7 +123,7 @@ module MergeRequests
return unless @commits.present?
merge_requests_for_source_branch.each do |merge_request|
- mr_commit_ids = Set.new(merge_request.commits.map(&:id))
+ mr_commit_ids = Set.new(merge_request.commits_sha)
new_commits, existing_commits = @commits.partition do |commit|
mr_commit_ids.include?(commit.id)