aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMura Li2019-09-17 01:27:05 +0800
committertechknowlogick2019-09-16 13:27:05 -0400
commit9e8df4b83853b91040ece3a6db424f26fcbad7ca (patch)
treee5c1a7bb4e17f109de3cf32ae9dec6effc35feea
parentd78aa189ec1d0467efe5e0b2450b40e01677cc27 (diff)
Fix pull merge 500 error caused by git-fetch breaking behaviors (#8194)
-rw-r--r--modules/pull/merge.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pull/merge.go b/modules/pull/merge.go
index 5c5ec610f..0e9e3b8b1 100644
--- a/modules/pull/merge.go
+++ b/modules/pull/merge.go
@@ -101,7 +101,7 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
}
// Fetch head branch
- if err := git.NewCommand("fetch", remoteRepoName, pr.HeadBranch).RunInDirPipeline(tmpBasePath, nil, &errbuf); err != nil {
+ if err := git.NewCommand("fetch", remoteRepoName, fmt.Sprintf("%s:refs/remotes/%s/%s", pr.HeadBranch, remoteRepoName, pr.HeadBranch)).RunInDirPipeline(tmpBasePath, nil, &errbuf); err != nil {
return fmt.Errorf("git fetch [%s -> %s]: %s", headRepoPath, tmpBasePath, errbuf.String())
}