Skip to content

Commit a5f87fe

Browse files
typelesstechknowlogick
authored andcommitted
Fix pull merge 500 error caused by git-fetch breaking behaviors (#8161)
1 parent 8964874 commit a5f87fe

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)