This commit is contained in:
Lunny Xiao
2025-05-11 16:58:54 -07:00
parent 35497493c8
commit 004e3bbe23
2 changed files with 5 additions and 5 deletions
+5 -2
View File
@@ -81,7 +81,7 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
return nil, err
}
return &Repository{
repo := &Repository{
Path: repoPath,
gogitRepo: gogitRepo,
gogitStorage: storage,
@@ -89,7 +89,10 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
commitCache: make(map[string]*Commit),
Ctx: ctx,
objectFormat: ParseGogitHash(plumbing.ZeroHash).Type(),
}, nil
}
repo.lastCommitCache = newLastCommitCache(repo.Path, repo, cache.GetCache())
return repo, nil
}
// Close this repository, in particular close the underlying gogitStorage if this is not nil