Fix empty commits now showing in repo overview (#7521)

* Fix empty commits now showing in repo overview

* add test

* make fmt
This commit is contained in:
silverwind 2019-07-22 14:03:15 +02:00 committed by Lauris BH
parent b0cd3b8ab9
commit fe7689a6b2
7 changed files with 24 additions and 13 deletions

View file

@ -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