aboutsummaryrefslogtreecommitdiff
path: root/reachability/connected.go
blob: 655c40b951f6e4a2701ffab991acfedee035bec8 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package reachability

import objectid "codeberg.org/lindenii/furgit/object/id"

// CheckConnected verifies that all objects reachable from wants (under the
// selected domain) can be fully traversed without missing-object/type/parse
// errors, excluding subgraphs rooted at haves.
//
// With commit-graph acceleration available,
// each visited commit is validated against the object store
// iff struct is set to true.
func (r *Reachability) CheckConnected(domain Domain, haves, wants map[objectid.ObjectID]struct{}, strict bool) error {
	walk := r.Walk(domain, haves, wants)

	walk.strict = strict
	for range walk.Seq() {
	}

	return walk.Err()
}