Check for keep-around commits once if target and source projects are the same

This reduces the number of RefExists RPC call.
This commit is contained in:
Ahmad Sherif 2018-02-07 15:03:42 +01:00
parent 826105dfda
commit 48568a9de0
1 changed files with 1 additions and 1 deletions

View File

@ -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)