Skip to content

Commit 2b9e0b4

Browse files
authored
should run RetrieveRepoMetas() for empty pr (#15187)
Signed-off-by: a1012112796 <[email protected]>
1 parent 3416e2a commit 2b9e0b4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

routers/repo/compare.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,15 @@ func PrepareCompareDiff(
431431
ctx.Data["IsNothingToCompare"] = true
432432
if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil {
433433
config := unit.PullRequestsConfig()
434+
434435
if !config.AutodetectManualMerge {
435-
ctx.Data["AllowEmptyPr"] = !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
436-
} else {
437-
ctx.Data["AllowEmptyPr"] = false
436+
allowEmptyPr := !(baseBranch == headBranch && ctx.Repo.Repository.Name == headRepo.Name)
437+
ctx.Data["AllowEmptyPr"] = allowEmptyPr
438+
439+
return !allowEmptyPr
438440
}
441+
442+
ctx.Data["AllowEmptyPr"] = false
439443
}
440444
return true
441445
}

0 commit comments

Comments
 (0)