Skip to content

Commit ff7eaa1

Browse files
authored
Show pull request selection even when unrelated branches (#11239) (#11283)
Fix #10525 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: guillep2k <[email protected]>
1 parent 5131206 commit ff7eaa1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

routers/repo/compare.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,6 @@ func PrepareCompareDiff(
320320
compareInfo.Commits = models.ParseCommitsWithStatus(compareInfo.Commits, headRepo)
321321
ctx.Data["Commits"] = compareInfo.Commits
322322
ctx.Data["CommitCount"] = compareInfo.Commits.Len()
323-
if ctx.Data["CommitCount"] == 0 {
324-
ctx.Data["PageIsComparePull"] = false
325-
}
326323

327324
if compareInfo.Commits.Len() == 1 {
328325
c := compareInfo.Commits.Front().Value.(models.SignCommitWithStatuses)

templates/repo/diff/compare.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
{{if .IsNothingToCompare}}
6161
<div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare"}}</div>
62-
{{else if .PageIsComparePull}}
62+
{{else if and .PageIsComparePull (gt .CommitCount 0)}}
6363
{{if .HasPullRequest}}
6464
<div class="ui segment">
6565
{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}

0 commit comments

Comments
 (0)