summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-06-16 15:00:58 +0100
committerSean McGivern <sean@gitlab.com>2017-07-06 17:36:10 +0100
commitaff5c9f3e5ecdd9eee2b2b60ab6367da878582fc (patch)
treee0ab89e6e733031b8296024d5e5d496e5b767516 /app/services
parent9274c3c1598f3ff32339e681d5812feeb0f62605 (diff)
downloadgitlab-ce-aff5c9f3e5ecdd9eee2b2b60ab6367da878582fc.tar.gz
Add table for merge request commits
This is an ID-less table with just three columns: an association to the merge request diff the commit belongs to, the relative order of the commit within the merge request diff, and the commit SHA itself. Previously we stored much more information about the commits, so that we could display them even when they were deleted from the repo. Since 8.0, we ensure that those commits are kept around for as long as the target repo itself is, so we don't need to duplicate that data in the database.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/merge_requests/refresh_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb
index e0e7c43f802..c5f959a1874 100644
--- a/app/services/merge_requests/refresh_service.rb
+++ b/app/services/merge_requests/refresh_service.rb
@@ -68,7 +68,7 @@ module MergeRequests
if merge_request.source_branch == @branch_name || force_push?
merge_request.reload_diff(current_user)
else
- mr_commit_ids = merge_request.commits_sha
+ mr_commit_ids = merge_request.commit_shas
push_commit_ids = @commits.map(&:id)
matches = mr_commit_ids & push_commit_ids
merge_request.reload_diff(current_user) if matches.any?
@@ -128,7 +128,7 @@ module MergeRequests
return unless @commits.present?
merge_requests_for_source_branch.each do |merge_request|
- mr_commit_ids = Set.new(merge_request.commits_sha)
+ mr_commit_ids = Set.new(merge_request.commit_shas)
new_commits, existing_commits = @commits.partition do |commit|
mr_commit_ids.include?(commit.id)
@@ -144,7 +144,7 @@ module MergeRequests
return unless @commits.present?
merge_requests_for_source_branch.each do |merge_request|
- commit_shas = merge_request.commits_sha
+ commit_shas = merge_request.commit_shas
wip_commit = @commits.detect do |commit|
commit.work_in_progress? && commit_shas.include?(commit.sha)