Skip to main content

is_excluded_within

Function is_excluded_within 

Source
pub fn is_excluded_within(root: &Path, path: &Path) -> bool
Expand description

Root-relative variant of is_excluded: only the components below root are matched against EXCLUDED_DIRS, so a project legitimately rooted under an excluded-name ancestor (~/.claude/worktrees/..., ~/Library/..., ~/dev/build/...) is not silently emptied to zero files (#358). Walkers must pass the same root they hand to WalkDir so the prefix strips textually without canonicalization cost.

A path outside root falls back to whole-path matching — the fail-safe direction: the fallback can only exclude more, never leak an excluded directory back in.