diff options
| author | 2026-02-21 15:29:40 +0800 | |
|---|---|---|
| committer | 2026-02-21 15:29:40 +0800 | |
| commit | 673902b14458f32fbf47efa3757279872bdfcb7e (patch) | |
| tree | cdcae5d8c7ee01e4931a306931fc79c01c1ea406 /objectstore/loose | |
| parent | repository: Add passthrough ReadStored*; add ref convenience funcs (diff) | |
| signature | No signature | |
repository, {ref,object}store: Make stores own their roots
Diffstat (limited to 'objectstore/loose')
| -rw-r--r-- | objectstore/loose/store.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/objectstore/loose/store.go b/objectstore/loose/store.go index b0f64971..05459a6c 100644 --- a/objectstore/loose/store.go +++ b/objectstore/loose/store.go @@ -9,11 +9,11 @@ import ( // Store reads loose Git objects from an objects directory root. // -// Store does not own root. Callers are responsible for closing root. +// Store owns root and closes it in Close. type Store struct { // root is the objects directory capability used for all object file access. // Object files are opened by relative paths like "<first2>/<rest>". - // Store does not own this root. + // Store owns this root. root *os.Root // algo is the expected object ID algorithm for lookups. algo objectid.Algorithm @@ -32,6 +32,5 @@ func New(root *os.Root, algo objectid.Algorithm) (*Store, error) { // Close releases resources associated with the backend. func (store *Store) Close() error { - _ = store - return nil + return store.root.Close() } |
