···1414 graph *commitgraphread.Reader
1515}
16161717-// New builds a Reachability over one object store.
1717+// New builds a Reachability over one object store with an optional
1818+// commit-graph reader for faster commit-domain traversal.
1819//
1920// Labels: Deps-Borrowed.
2020-func New(store objectstore.ReadingStore) *Reachability {
2121- return &Reachability{store: store}
2222-}
2323-2424-// NewWithCommitGraph builds a Reachability over one object store with an
2525-// optional commit-graph reader for faster commit-domain traversal.
2626-//
2727-// Labels: Deps-Borrowed.
2828-func NewWithCommitGraph(store objectstore.ReadingStore, graph *commitgraphread.Reader) *Reachability {
2121+func New(store objectstore.ReadingStore, graph *commitgraphread.Reader) *Reachability {
2922 return &Reachability{store: store, graph: graph}
3023}
+7-7
reachability/unit_test.go
···9494 tag1 := store.AddObject(objecttype.TypeTag, tagBody(commit2, objecttype.TypeCommit))
9595 tag2 := store.AddObject(objecttype.TypeTag, tagBody(tag1, objecttype.TypeTag))
96969797- r := reachability.New(store)
9797+ r := reachability.New(store, nil)
9898 walk := r.Walk(reachability.DomainCommits, nil, map[objectid.ObjectID]struct{}{tag2: {}})
9999100100 got := collectSeq(walk.Seq())
···126126 }}}))
127127 commit := store.AddObject(objecttype.TypeCommit, commitBody(tree))
128128129129- r := reachability.New(store)
129129+ r := reachability.New(store, nil)
130130 walk := r.Walk(reachability.DomainCommits, map[objectid.ObjectID]struct{}{commit: {}}, map[objectid.ObjectID]struct{}{commit: {}})
131131132132 got := collectSeq(walk.Seq())
···155155 }}}))
156156 tag := store.AddObject(objecttype.TypeTag, tagBody(tree, objecttype.TypeTree))
157157158158- r := reachability.New(store)
158158+ r := reachability.New(store, nil)
159159 walk := r.Walk(reachability.DomainCommits, nil, map[objectid.ObjectID]struct{}{tag: {}})
160160 _ = collectSeq(walk.Seq())
161161···191191 tag1 := store.AddObject(objecttype.TypeTag, tagBody(commit2, objecttype.TypeCommit))
192192 tag2 := store.AddObject(objecttype.TypeTag, tagBody(tag1, objecttype.TypeTag))
193193194194- r := reachability.New(store)
194194+ r := reachability.New(store, nil)
195195 walk := r.Walk(
196196 reachability.DomainCommits,
197197 map[objectid.ObjectID]struct{}{tag1: {}},
···236236 }}))
237237 commit := store.AddObject(objecttype.TypeCommit, commitBody(rootTree))
238238239239- r := reachability.New(store)
239239+ r := reachability.New(store, nil)
240240 walk := r.Walk(reachability.DomainObjects, nil, map[objectid.ObjectID]struct{}{commit: {}})
241241242242 got := collectSeq(walk.Seq())
···273273 missingParent := store.Algorithm().Sum([]byte("missing-parent"))
274274 commit := store.AddObject(objecttype.TypeCommit, commitBody(tree, missingParent))
275275276276- r := reachability.New(store)
276276+ r := reachability.New(store, nil)
277277278278 err := r.CheckConnected(reachability.DomainCommits, nil, map[objectid.ObjectID]struct{}{commit: {}})
279279 if err == nil {
···295295 t.Parallel()
296296297297 testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) { //nolint:thelper
298298- r := reachability.New(newCountingMemStore(algo))
298298+ r := reachability.New(newCountingMemStore(algo), nil)
299299 walk := r.Walk(reachability.Domain(99), nil, nil)
300300301301 _ = collectSeq(walk.Seq())