Backport #13218 Fix #13216 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
151daf73a6
commit
d795bfc964
1 changed files with 1 additions and 1 deletions
|
@ -311,7 +311,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C
|
||||||
compareInfo, err := ctx.Repo.GitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(),
|
compareInfo, err := ctx.Repo.GitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(),
|
||||||
pull.MergeBase, pull.GetGitRefName())
|
pull.MergeBase, pull.GetGitRefName())
|
||||||
if err != nil {
|
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["IsPullRequestBroken"] = true
|
||||||
ctx.Data["BaseTarget"] = pull.BaseBranch
|
ctx.Data["BaseTarget"] = pull.BaseBranch
|
||||||
ctx.Data["NumCommits"] = 0
|
ctx.Data["NumCommits"] = 0
|
||||||
|
|
Reference in a new issue