Skip to content

Commit d795bfc

Browse files
authored
When the git ref is unable to be found return broken pr (#13218) (#13303)
Backport #13218 Fix #13216 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 151daf7 commit d795bfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/repo/pull.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C
311311
compareInfo, err := ctx.Repo.GitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(),
312312
pull.MergeBase, pull.GetGitRefName())
313313
if err != nil {
314-
if strings.Contains(err.Error(), "fatal: Not a valid object name") {
314+
if strings.Contains(err.Error(), "fatal: Not a valid object name") || strings.Contains(err.Error(), "unknown revision or path not in the working tree") {
315315
ctx.Data["IsPullRequestBroken"] = true
316316
ctx.Data["BaseTarget"] = pull.BaseBranch
317317
ctx.Data["NumCommits"] = 0

0 commit comments

Comments
 (0)