diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 20f718d6c2..e7ff533d6a 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -1202,6 +1202,11 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption) } headBranchRef := headBranch + if headIsBranch { + headBranchRef = git.BranchPrefix + headBranch + } else if headIsTag { + headBranchRef = git.TagPrefix + headBranch + } compareInfo, err := headGitRepo.GetCompareInfo(repo_model.RepoPath(baseRepo.Owner.Name, baseRepo.Name), baseBranchRef, headBranchRef, false, false) if err != nil {