From 28f8308d47af30e3ac3796034d7a3f6d5f375a3e Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 2 May 2020 09:06:01 +0100 Subject: [PATCH] Show pull request selection even when unrelated branches (#11239) Fix #10525 Signed-off-by: Andrew Thornton Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao --- routers/repo/compare.go | 3 --- templates/repo/diff/compare.tmpl | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 198c75e6521..622c911bbe4 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -320,9 +320,6 @@ func PrepareCompareDiff( compareInfo.Commits = models.ParseCommitsWithStatus(compareInfo.Commits, headRepo) ctx.Data["Commits"] = compareInfo.Commits ctx.Data["CommitCount"] = compareInfo.Commits.Len() - if ctx.Data["CommitCount"] == 0 { - ctx.Data["PageIsComparePull"] = false - } if compareInfo.Commits.Len() == 1 { c := compareInfo.Commits.Front().Value.(models.SignCommitWithStatuses) diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index e98823953c7..b0886364344 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -59,7 +59,7 @@ {{if .IsNothingToCompare}}
{{.i18n.Tr "repo.pulls.nothing_to_compare"}}
- {{else if .PageIsComparePull}} + {{else if and .PageIsComparePull (gt .CommitCount 0)}} {{if .HasPullRequest}}
{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}