Commit 59dd9e57 authored by Sean McGivern's avatar Sean McGivern

Use Repository#fetch_ref

parent 1bda1e62
...@@ -38,8 +38,13 @@ module MergeRequests ...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment