blob: 8e0a0902c5fa61e1cc3f7b3f2c12465b1c8df950 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package reachability
import (
objectid "codeberg.org/lindenii/furgit/object/id"
)
// Walk is one single-use iterator traversal.
//
// Labels: MT-Unsafe.
type Walk struct {
reachability *Reachability
domain Domain
haves map[objectid.ObjectID]struct{}
wants map[objectid.ObjectID]struct{}
strict bool
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.
//
// Walk retains haves and wants as provided.
//
// Labels: Life-Parent.
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
}
|