浏览代码

When the git ref is unable to be found return broken pr (#13218) (#13303)

Backport #13218

Fix #13216

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.13.0-rc2
zeripath 3 年前
父节点
当前提交
d795bfc964
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      routers/repo/pull.go

+ 1
- 1
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

正在加载...
取消
保存