aboutsummaryrefslogtreecommitdiff
path: root/reachability/walk.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 11:32:17 +0800
committerGravatar Runxi Yu2026-03-06 11:32:17 +0800
commit362943bf4df40d31f66e12e225daee9d7a49bc0e (patch)
treeda19d49b59a5ba9a245f6698c51d4a3d35e70956 /reachability/walk.go
parentobjectstore/packed: Split files (diff)
signatureNo signature
reachability: Split files v0.1.58
Diffstat (limited to 'reachability/walk.go')
-rw-r--r--reachability/walk.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/reachability/walk.go b/reachability/walk.go
index 13400e89..e6de8684 100644
--- a/reachability/walk.go
+++ b/reachability/walk.go
@@ -15,3 +15,23 @@ type Walk struct {
seqUsed bool
err error
}
+
+// Walk creates one single-use traversal over the selected domain.
+//
+// In DomainCommits, when a commit-graph reader is attached, parent expansion
+// may use commit-graph metadata for speed.
+func (r *Reachability) Walk(domain Domain, haves, wants map[objectid.ObjectID]struct{}) *Walk {
+ walk := &Walk{
+ reachability: r,
+ domain: domain,
+ haves: haves,
+ wants: wants,
+ }
+
+ err := validateDomain(domain)
+ if err != nil {
+ walk.err = err
+ }
+
+ return walk
+}