summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2020-12-08 09:46:50 +0800
committerGitHub <noreply@github.com>2020-12-08 02:46:50 +0100
commit682f0b046066ee64f9a6c8881377b304db3e6f9d (patch)
tree8d7233ca2763ea4d3e3a42d3eaeffb9c1de2a138 /services
parenta33db35b386ebd92759fed154774cf6a6a7b4fa2 (diff)
downloadgitea-682f0b046066ee64f9a6c8881377b304db3e6f9d.tar.gz
gitea-682f0b046066ee64f9a6c8881377b304db3e6f9d.zip
Fix Pull Merge when tag with same name as base branch exist (#13882)
fix dst refspec error in 'Push back to upstream' when base branch have same name with a tag. fix #13851 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'services')
-rw-r--r--services/pull/merge.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 3d856724cd..2c4f939e0a 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -411,7 +411,7 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge
)
// Push back to upstream.
- if err := git.NewCommand("push", "origin", baseBranch+":"+pr.BaseBranch).RunInDirTimeoutEnvPipeline(env, -1, tmpBasePath, &outbuf, &errbuf); err != nil {
+ if err := git.NewCommand("push", "origin", baseBranch+":refs/heads/"+pr.BaseBranch).RunInDirTimeoutEnvPipeline(env, -1, tmpBasePath, &outbuf, &errbuf); err != nil {
if strings.Contains(errbuf.String(), "non-fast-forward") {
return "", &git.ErrPushOutOfDate{
StdOut: outbuf.String(),