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 authored and Lauris BH committed 2019-07-22 15:03:15 +03:00
1 parent b0cd3b8ab9
commit fe7689a6b2
7 files changed
+24 -13

No files matched your search

+3 -1
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