Skip to content

Commit 9e8df4b

Browse files
typelesstechknowlogick
authored andcommitted
Fix pull merge 500 error caused by git-fetch breaking behaviors (#8194)
1 parent d78aa18 commit 9e8df4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/pull/merge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
101101
}
102102

103103
// Fetch head branch
104-
if err := git.NewCommand("fetch", remoteRepoName, pr.HeadBranch).RunInDirPipeline(tmpBasePath, nil, &errbuf); err != nil {
104+
if err := git.NewCommand("fetch", remoteRepoName, fmt.Sprintf("%s:refs/remotes/%s/%s", pr.HeadBranch, remoteRepoName, pr.HeadBranch)).RunInDirPipeline(tmpBasePath, nil, &errbuf); err != nil {
105105
return fmt.Errorf("git fetch [%s -> %s]: %s", headRepoPath, tmpBasePath, errbuf.String())
106106
}
107107

0 commit comments

Comments
 (0)