diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-06 19:14:19 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-06 20:09:00 +0300 |
commit | 663b3c968f73f8ffebf32059fed86192ecbee5d8 (patch) | |
tree | 01bd5692cc2e6ced1af614da1754855c76421425 /app/services | |
parent | 8b53d9efe648f10e0572c2d8017489d0d3bb4755 (diff) |
Condense commits already in target branch when updating merge request source branch.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index 96761bec99f..ea846472766 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -82,8 +82,14 @@ module MergeRequests merge_requests = filter_merge_requests(merge_requests) merge_requests.each do |merge_request| + mr_commit_ids = Set.new(merge_request.commits.map(&:id)) + + new_commits, existing_commits = @commits.partition do |commit| + mr_commit_ids.include?(commit.id) + end + Note.create_new_commits_note(merge_request, merge_request.project, - @current_user, @commits) + @current_user, new_commits, existing_commits) end end |