summaryrefslogtreecommitdiffstats
path: root/modules/git/commit_info.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2019-07-22 14:03:15 +0200
committerLauris BH <lauris@nix.lv>2019-07-22 15:03:15 +0300
commitfe7689a6b28b644ef309350cf01f563201f44d10 (patch)
tree7d5d5ff94892be59e56eb7d4d59fcadf40e5ff96 /modules/git/commit_info.go
parentb0cd3b8ab9b174f11fd4db8737106be5caf9cc1c (diff)
downloadgitea-fe7689a6b28b644ef309350cf01f563201f44d10.tar.gz
gitea-fe7689a6b28b644ef309350cf01f563201f44d10.zip
Fix empty commits now showing in repo overview (#7521)
* Fix empty commits now showing in repo overview * add test * make fmt
Diffstat (limited to 'modules/git/commit_info.go')
-rw-r--r--modules/git/commit_info.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/git/commit_info.go b/modules/git/commit_info.go
index 8417226f8b..3fa80457ac 100644
--- a/modules/git/commit_info.go
+++ b/modules/git/commit_info.go
@@ -68,7 +68,9 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache LastCom
// get it for free during the tree traversal and it's used for listing
// pages to display information about newest commit for a given path.
var treeCommit *Commit
- if rev, ok := revs[""]; ok {
+ if treePath == "" {
+ treeCommit = commit
+ } else if rev, ok := revs[""]; ok {
treeCommit = convertCommit(rev)
}
return commitsInfo, treeCommit, nil