Use Repository#fetch_ref

This commit is contained in:
Sean McGivern 2016-08-30 16:23:45 +01:00
parent 1bda1e62de
commit 59dd9e576b

View file

@ -38,8 +38,13 @@ module MergeRequests
def fetch_their_commit! def fetch_their_commit!
return if rugged.include?(conflicts.their_commit.oid) return if rugged.include?(conflicts.their_commit.oid)
remote = rugged.remotes.create_anonymous(merge_request.target_project.repository.path_to_repo) random_string = SecureRandom.hex
remote.fetch(merge_request.target_branch)
project.repository.fetch_ref(
merge_request.target_project.repository.path_to_repo,
"refs/heads/#{merge_request.target_branch}",
"refs/tmp/#{random_string}/head"
)
end end
end end
end end