summaryrefslogtreecommitdiffstats
path: root/templates/repo/commits_table.tmpl
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-04-09 21:45:58 +0100
committerGitHub <noreply@github.com>2019-04-09 21:45:58 +0100
commit89cc7c646deea10666fd7dc09c485e7910675cce (patch)
treeb58c1d778e920e9fe46d175ce7e6d28f77dc8fd2 /templates/repo/commits_table.tmpl
parent7350e439bfa580d6693eac9848353e83e51a3525 (diff)
downloadgitea-89cc7c646deea10666fd7dc09c485e7910675cce.tar.gz
gitea-89cc7c646deea10666fd7dc09c485e7910675cce.zip
Prevent server 500 on compare branches with no common history (#6555)
* Prevent 500 if there is no common mergebase * Prevent creation of PR with no history
Diffstat (limited to 'templates/repo/commits_table.tmpl')
-rw-r--r--templates/repo/commits_table.tmpl12
1 files changed, 8 insertions, 4 deletions
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 53c2f98f4d..55c550ae95 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -1,9 +1,13 @@
<h4 class="ui top attached header">
<div class="ui stackable grid">
- <div class="six wide column">
- {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
+ <div class="ten wide column">
+ {{if or .PageIsCommits (gt .CommitCount 0)}}
+ {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
+ {{else}}
+ {{.i18n.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch }} {{if .Branch}}({{.Branch}}){{end}}
+ {{end}}
</div>
- <div class="ten wide right aligned column">
+ <div class="six wide right aligned column">
{{if .PageIsCommits}}
<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL | EscapePound}}/search">
<div class="ui tiny search input">
@@ -23,7 +27,7 @@
</div>
</h4>
-{{if .Commits}}
+{{if and .Commits (gt .CommitCount 0)}}
<div class="ui attached table segment">
<table class="ui very basic striped fixed table single line" id="commits-table">
<thead>