diff options
Diffstat (limited to 'modules/git/last_commit_cache.go')
-rw-r--r-- | modules/git/last_commit_cache.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/git/last_commit_cache.go b/modules/git/last_commit_cache.go index e2d296641f..d4ec517b51 100644 --- a/modules/git/last_commit_cache.go +++ b/modules/git/last_commit_cache.go @@ -26,6 +26,9 @@ func (c *LastCommitCache) getCacheKey(repoPath, ref, entryPath string) string { // Put put the last commit id with commit and entry path func (c *LastCommitCache) Put(ref, entryPath, commitID string) error { + if c == nil || c.cache == nil { + return nil + } log.Debug("LastCommitCache save: [%s:%s:%s]", ref, entryPath, commitID) return c.cache.Put(c.getCacheKey(c.repoPath, ref, entryPath), commitID, c.ttl()) } |