Browse Source

should run RetrieveRepoMetas() for empty pr (#15187) (#15190)

Signed-off-by: a101211279 <1012112796@qq.com>
tags/v1.14.0
a1012112796 3 years ago
parent
commit
61308825a6
No account linked to committer's email address
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      routers/repo/compare.go

+ 7
- 3
routers/repo/compare.go View File

@@ -431,11 +431,15 @@ func PrepareCompareDiff(
ctx.Data["IsNothingToCompare"] = true
if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil {
config := unit.PullRequestsConfig()

if !config.AutodetectManualMerge {
ctx.Data["AllowEmptyPr"] = !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
} else {
ctx.Data["AllowEmptyPr"] = false
allowEmptyPr := !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
ctx.Data["AllowEmptyPr"] = allowEmptyPr

return !allowEmptyPr
}

ctx.Data["AllowEmptyPr"] = false
}
return true
}

Loading…
Cancel
Save