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.

reachability: Document contract

Runxi Yu f40daef1 94a3920b

+13 -1
+5 -1
reachability/reachability.go
··· 8 8 9 9 // Reachability provides graph traversal over objects in one object store. 10 10 // 11 - // It is not safe for concurrent use. 11 + // Labels: MT-Unsafe. 12 12 type Reachability struct { 13 13 store objectstore.ReadingStore 14 14 graph *commitgraphread.Reader 15 15 } 16 16 17 17 // New builds a Reachability over one object store. 18 + // 19 + // Labels: Deps-Borrowed. 18 20 func New(store objectstore.ReadingStore) *Reachability { 19 21 return &Reachability{store: store} 20 22 } 21 23 22 24 // NewWithCommitGraph builds a Reachability over one object store with an 23 25 // optional commit-graph reader for faster commit-domain traversal. 26 + // 27 + // Labels: Deps-Borrowed. 24 28 func NewWithCommitGraph(store objectstore.ReadingStore, graph *commitgraphread.Reader) *Reachability { 25 29 return &Reachability{store: store, graph: graph} 26 30 }
+6
reachability/walk.go
··· 5 5 ) 6 6 7 7 // Walk is one single-use iterator traversal. 8 + // 9 + // Labels: MT-Unsafe. 8 10 type Walk struct { 9 11 reachability *Reachability 10 12 domain Domain ··· 20 22 // 21 23 // In DomainCommits, when a commit-graph reader is attached, parent expansion 22 24 // may use commit-graph metadata for speed. 25 + // 26 + // Walk retains haves and wants as provided. 27 + // 28 + // Labels: Life-Parent. 23 29 func (r *Reachability) Walk(domain Domain, haves, wants map[objectid.ObjectID]struct{}) *Walk { 24 30 walk := &Walk{ 25 31 reachability: r,
+2
reachability/walk_seq.go
··· 8 8 ) 9 9 10 10 // Seq returns the traversal sequence. It is single-use. 11 + // 12 + // Labels: Life-Parent. 11 13 func (walk *Walk) Seq() iter.Seq[objectid.ObjectID] { 12 14 if walk.seqUsed { 13 15 return func(yield func(objectid.ObjectID) bool) {