fix: git cache (#38763)

1. always use "last commit cache"
2. correctly build the cache key for any input (SafeCacheKey)
3. fix the git note "last commit cache FIXME" and avoid OOM
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-08-05 00:17:07 +08:00
1 parent 6347a33b34
commit deccd53c24
26 files changed
+213 -298

No files matched your search

-3
View File
@@ -11,9 +11,6 @@ import (
// CacheCommit will cache the commit from the gitRepository
func (c *Commit) CacheCommit(ctx context.Context, gitRepo *Repository) error {
if gitRepo.LastCommitCache == nil {
return nil
}
return c.recursiveCache(ctx, gitRepo, c.Tree(), "", 1)
}