aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/last_commit_cache_nogogit.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/git/last_commit_cache_nogogit.go b/modules/git/last_commit_cache_nogogit.go
index ff9f9ff1cf..faf6e23fa8 100644
--- a/modules/git/last_commit_cache_nogogit.go
+++ b/modules/git/last_commit_cache_nogogit.go
@@ -94,7 +94,8 @@ func (c *LastCommitCache) recursiveCache(ctx context.Context, commit *Commit, tr
if err := c.Put(commit.ID.String(), path.Join(treePath, entry), entryCommit.ID.String()); err != nil {
return err
}
- if entryMap[entry].IsDir() {
+ // entryMap won't contain "" therefore skip this.
+ if treeEntry := entryMap[entry]; treeEntry != nil && treeEntry.IsDir() {
subTree, err := tree.SubTree(entry)
if err != nil {
return err