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

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796 2021-03-30 00:02:01 +08:00 committed by GitHub
parent 0cccad04f0
commit 61308825a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -431,11 +431,15 @@ func PrepareCompareDiff(
ctx.Data["IsNothingToCompare"] = true ctx.Data["IsNothingToCompare"] = true
if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil { if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil {
config := unit.PullRequestsConfig() config := unit.PullRequestsConfig()
if !config.AutodetectManualMerge { if !config.AutodetectManualMerge {
ctx.Data["AllowEmptyPr"] = !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name) allowEmptyPr := !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
} else { ctx.Data["AllowEmptyPr"] = allowEmptyPr
ctx.Data["AllowEmptyPr"] = false
return !allowEmptyPr
} }
ctx.Data["AllowEmptyPr"] = false
} }
return true return true
} }