From ff7eaa1eb4dfbe800b5768332516378bf7dfd117 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Mon, 4 May 2020 08:38:26 -0300 Subject: [PATCH] Show pull request selection even when unrelated branches (#11239) (#11283) Fix #10525 Signed-off-by: Andrew Thornton Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- 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 92a666891e..cabb7365f4 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 50a51c44ac..db097ee356 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}}