diff options
author | a1012112796 <1012112796@qq.com> | 2021-03-29 14:58:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 07:58:48 +0100 |
commit | 2b9e0b4d1bfb1b21851e1d56373cbcc52b2c2dfe (patch) | |
tree | 82c8491212f5fc423db8d881cb9cc1bc9bfb77c5 /routers | |
parent | 3416e2a82586fca4cd452b93237b979300f55d62 (diff) | |
download | gitea-2b9e0b4d1bfb1b21851e1d56373cbcc52b2c2dfe.tar.gz gitea-2b9e0b4d1bfb1b21851e1d56373cbcc52b2c2dfe.zip |
should run RetrieveRepoMetas() for empty pr (#15187)
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/compare.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/repo/compare.go b/routers/repo/compare.go index a8f4f8add8..38c3005cf7 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -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 } |