Use Repository#fetch_ref
This commit is contained in:
parent
1bda1e62de
commit
59dd9e576b
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue