pub fn walk_module_tree<E>(
root: &Path,
visitor: &mut dyn FnMut(&Path, u64) -> Result<(), E>,
) -> Result<TreeStats, WalkError<E>>Expand description
Walks every regular file under root, enforcing containment and
metadata exclusion. Calls visitor for each file with its path
and size. Returns aggregate statistics.
Rules enforced:
- Entries named
.gitor.sparse.jsonare skipped. - Symlinks whose canonical target is outside the module root are rejected
with
ModuleWalkError::SymlinkEscapesRoot. - Symlinks targeting non-module content (
.git,.sparse.json) are rejected withModuleWalkError::SymlinkTargetsMetadata. - Directory symlinks are rejected to prevent cycles.
- Only regular files (and file symlinks to valid targets) are visited.