summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2018-02-07 15:03:42 +0100
committerAhmad Sherif <me@ahmadsherif.com>2018-02-07 15:07:16 +0100
commit48568a9de00443507aafe3020d2f00bd538d874e (patch)
tree2bd2e644efe6cdd2d71069f43b5286384d2fab82
parent826105dfda91081e92dfd5ca7f85a1343893e049 (diff)
downloadgitlab-ce-48568a9de00443507aafe3020d2f00bd538d874e.tar.gz
Check for keep-around commits once if target and source projects are the same
This reduces the number of RefExists RPC call.
-rw-r--r--app/models/merge_request_diff.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb
index 69a846da9be..c1c27ccf3e5 100644
--- a/app/models/merge_request_diff.rb
+++ b/app/models/merge_request_diff.rb
@@ -290,7 +290,7 @@ class MergeRequestDiff < ActiveRecord::Base
end
def keep_around_commits
- [repository, merge_request.source_project.repository].each do |repo|
+ [repository, merge_request.source_project.repository].uniq.each do |repo|
repo.keep_around(start_commit_sha)
repo.keep_around(head_commit_sha)
repo.keep_around(base_commit_sha)