summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-10-20 13:52:54 +0100
committerGitHub <noreply@github.com>2020-10-20 20:52:54 +0800
commit0aec2a294b4029e43f25f78fc767ee29e3d3d4bc (patch)
tree2a6465c419a1aabf7291a0e10906f793af18cb34 /routers
parent5626811e5298fa45a8a9b4af76fd5644ac3d3b3b (diff)
downloadgitea-0aec2a294b4029e43f25f78fc767ee29e3d3d4bc.tar.gz
gitea-0aec2a294b4029e43f25f78fc767ee29e3d3d4bc.zip
When the git ref is unable to be found return broken pr (#13218)
Fix #13216 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/pull.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 54da7b76b7..0ae126215a 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -311,7 +311,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C
compareInfo, err := ctx.Repo.GitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(),
pull.MergeBase, pull.GetGitRefName())
if err != nil {
- if strings.Contains(err.Error(), "fatal: Not a valid object name") {
+ if strings.Contains(err.Error(), "fatal: Not a valid object name") || strings.Contains(err.Error(), "unknown revision or path not in the working tree") {
ctx.Data["IsPullRequestBroken"] = true
ctx.Data["BaseTarget"] = pull.BaseBranch
ctx.Data["NumCommits"] = 0