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.

*: Remove Close from object/ref store interfaces

At places where you own the object, you should have the literal
implementation with Close. If you're using it via the interface, then
you probably don't own that store, and you shouldn't be closing it.

Thanks to Michael Muré from git-bug for this point.

Runxi Yu f50ac551 5b0b1441

+2 -34
-3
TODO
··· 60 60 try to resolve that probably 61 61 * Needs much better diff API 62 62 * revwalk/log 63 - 64 - 65 - * Does Close belong in interfaces at all?
-4
network/receivepack/service/run_hook.go
··· 96 96 } 97 97 98 98 defer func() { 99 - if quarantineObjectsStore != nil { 100 - _ = quarantineObjectsStore.Close() 101 - } 102 - 103 99 if quarantinePackedStore != nil { 104 100 _ = quarantinePackedStore.Close() 105 101 }
-5
object/store/reading.go
··· 52 52 // 53 53 // Backends without dynamic discovery should do nothing and return nil. 54 54 Refresh() error 55 - 56 - // Close releases resources associated with the backend. 57 - // 58 - // Labels: MT-Unsafe. 59 - Close() error 60 55 }
-6
ref/store/reading.go
··· 31 31 // 32 32 // Labels: Life-Parent. 33 33 List(pattern string) ([]ref.Ref, error) 34 - // Close releases resources associated with the store. 35 - // 36 - // Transactions and batches borrowing the store are invalid after Close. 37 - // 38 - // Labels: MT-Unsafe. 39 - Close() error 40 34 }
-14
repository/close.go
··· 8 8 func (repo *Repository) Close() error { 9 9 var errs []error 10 10 11 - if repo.refs != nil { 12 - err := repo.refs.Close() 13 - if err != nil { 14 - errs = append(errs, err) 15 - } 16 - } 17 - 18 - if repo.objects != nil { 19 - err := repo.objects.Close() 20 - if err != nil { 21 - errs = append(errs, err) 22 - } 23 - } 24 - 25 11 if repo.commitGraph != nil { 26 12 err := repo.commitGraph.Close() 27 13 if err != nil {
+1 -1
repository/objects.go
··· 81 81 // bytes, or streamed object contents. Callers who want typed object values 82 82 // should usually prefer [Repository.Fetcher]. 83 83 // 84 - // Labels: Life-Parent, Close-No. 84 + // Labels: Life-Parent. 85 85 // 86 86 //nolint:ireturn 87 87 func (repo *Repository) Objects() objectstore.ReadingStore {
+1 -1
repository/refs.go
··· 8 8 // A common pattern is to resolve a reference first and then pass the resulting 9 9 // object ID to [Repository.Fetcher] or [Repository.Objects]. 10 10 // 11 - // Labels: Life-Parent, Close-No. 11 + // Labels: Life-Parent. 12 12 // 13 13 //nolint:ireturn 14 14 func (repo *Repository) Refs() refstore.ReadWriteStore {