pub fn reachable_objects(
store: &ObjectStore,
root: &Hash,
) -> Result<BTreeSet<Hash>, StoreError>Expand description
Collect every object reachable from commit root — the full closure
needed to reconstruct the commit on a fresh store. Walks, in order:
rootcommit → itstree_hash+ everyparent.- each tree → every entry’s
object_hash(blob / tree / chunked-blob). - nested trees → recurse.
- chunked-blob manifests → every
chunks[i]hash.
Deltas are not produced by any path the push code drives, and remix objects are walked like commits (tree + parents) per SPEC-OBJECTS §6.
Returns a BTreeSet so iteration order is deterministic — the
push code uses that to build reproducible packfiles. Deduplication
happens naturally via the set.
§Errors
StoreError::ObjectNotFoundifrootitself is missing from the store. Missing referenced objects (e.g. a tree listing a blob that got pruned) are a harder failure and propagate via the same variant — callers pushing partial repos should fix their store before pushing.- Other
StoreErrorvariants propagate as-is.