Skip to content

Commit

Permalink
should run RetrieveRepoMetas() for empty pr (#15187) (#15190)
Browse files Browse the repository at this point in the history
Signed-off-by: a1012112796 <1012112796@qq.com>
  • Loading branch information
a1012112796 committed Mar 29, 2021
1 parent 0cccad0 commit 6130882
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions routers/repo/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6130882

Please sign in to comment.