Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

objectstore/packed: Document refresh semantics

Runxi Yu 0f67e6f5 5c4e6183

+9 -1
+1
objectstore/packed/close.go
··· 3 3 // Close releases mapped pack/index resources associated with the store. 4 4 // 5 5 // Store borrows its root, so Close does not close it. 6 + // Close releases cached pack/index mappings retained by the store. 6 7 // 7 8 // Repeated calls to Close are undefined behavior. 8 9 func (store *Store) Close() error {
+6 -1
objectstore/packed/idx_lookup_candidates.go
··· 22 22 candidateByPack map[string]packCandidate 23 23 } 24 24 25 - // Refresh rescans objects/pack and atomically installs a fresh candidate list. 25 + // Refresh rescans objects/pack and atomically installs a fresh candidate list 26 + // for future lookups. 27 + // 28 + // Refresh does not invalidate existing readers. Cached pack/index mappings, 29 + // including ones for previously visible candidates, may be retained until 30 + // Close. 26 31 func (store *Store) Refresh() error { 27 32 store.refreshMu.Lock() 28 33 defer store.refreshMu.Unlock()
+2
objectstore/packed/store.go
··· 11 11 ) 12 12 13 13 // Store reads Git objects from pack/index files under an objects/pack root. 14 + // 15 + // Store borrows its root. Cached pack/index mappings are retained until Close. 14 16 type Store struct { 15 17 // root is the borrowed objects/pack capability used for all file access. 16 18 root *os.Root