From 673902b14458f32fbf47efa3757279872bdfcb7e Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 21 Feb 2026 15:29:40 +0800 Subject: repository, {ref,object}store: Make stores own their roots --- objectstore/loose/store.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'objectstore/loose') 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 "/". - // 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() } -- cgit v1.3.1-10-gc9f91