Skip to content

Commit e2df833

Browse files
author
marty
committed
fix
1 parent 3705168 commit e2df833

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

routers/web/repo/pull.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
527527
return nil
528528
}
529529

530+
if compareInfo.HeadCommitID == compareInfo.MergeBase {
531+
ctx.Data["IsNothingToCompare"] = true
532+
}
533+
530534
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
531535

532536
if pull.IsWorkInProgress() {

templates/repo/commits_table.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<div class="commits-table-left df ac">
33
{{if or .PageIsCommits (gt .CommitCount 0)}}
44
{{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
5+
{{else if .IsNothingToCompare }}
6+
{{.i18n.Tr "repo.pulls.is_empty" $.BaseBranch $.HeadBranch }} {{if .Branch}}({{.Branch}}){{end}}
7+
58
{{else}}
69
{{.i18n.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch }} {{if .Branch}}({{.Branch}}){{end}}
710
{{end}}

0 commit comments

Comments
 (0)