summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorAdam Niedzielski <adamsunday@gmail.com>2016-12-01 12:17:30 +0100
committerAdam Niedzielski <adamsunday@gmail.com>2016-12-01 12:17:30 +0100
commitcb6f8cdfc23a18daf33288c95ae8badec63f53ad (patch)
treecad717c7ba416e3fc7974c833cff154d3a1449a2 /app/services
parent2adc6568a6f94b2844c95a0b699a0be9bb8980d1 (diff)
downloadgitlab-ce-cb6f8cdfc23a18daf33288c95ae8badec63f53ad.tar.gz
Replace references to MergeRequestDiff#commits with st_commitsuse-st-commits-where-possible
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')
-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)