diff options
Diffstat (limited to 'routers/repo/compare.go')
-rw-r--r-- | routers/repo/compare.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 2eef20f5ff..a8f4f8add8 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -429,6 +429,14 @@ func PrepareCompareDiff( if headCommitID == compareInfo.MergeBase { 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 + } + } return true } |