Skip to content

Commit 682f0b0

Browse files
a10121127966543zeripath
authored
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 <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent a33db35 commit 682f0b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/pull/merge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func rawMerge(pr *models.PullRequest, doer *models.User, mergeStyle models.Merge
411411
)
412412

413413
// Push back to upstream.
414-
if err := git.NewCommand("push", "origin", baseBranch+":"+pr.BaseBranch).RunInDirTimeoutEnvPipeline(env, -1, tmpBasePath, &outbuf, &errbuf); err != nil {
414+
if err := git.NewCommand("push", "origin", baseBranch+":refs/heads/"+pr.BaseBranch).RunInDirTimeoutEnvPipeline(env, -1, tmpBasePath, &outbuf, &errbuf); err != nil {
415415
if strings.Contains(errbuf.String(), "non-fast-forward") {
416416
return "", &git.ErrPushOutOfDate{
417417
StdOut: outbuf.String(),

0 commit comments

Comments
 (0)