summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorMarty <58218546+PotatoesFall@users.noreply.github.com>2021-07-29 04:32:48 +0200
committerGitHub <noreply@github.com>2021-07-29 03:32:48 +0100
commit4e68d6f41d21e7c5465be6bdb6713c36eb586dfd (patch)
treeec749491e1ca2990cf3eea03bd5b711d8fedeb77 /routers
parent33e0b38287fdc3487112062300b8dd3c95415ee7 (diff)
downloadgitea-4e68d6f41d21e7c5465be6bdb6713c36eb586dfd.tar.gz
gitea-4e68d6f41d21e7c5465be6bdb6713c36eb586dfd.zip
Show correct text when comparing commits on empty pull request (#16569)
* fix * use own text * Update templates/repo/commits_table.tmpl Co-authored-by: marty <m.karkossa@ultraware.nl> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/pull.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index 15c9f14808..5c61e0d5fa 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -527,6 +527,10 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
return nil
}
+ if compareInfo.HeadCommitID == compareInfo.MergeBase {
+ ctx.Data["IsNothingToCompare"] = true
+ }
+
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
if pull.IsWorkInProgress() {