Expand description
Shared filesystem helpers: directory-size walk and filesystem-capacity probe.
The .git-skipping, hardlink-deduped walk lives here so guards, Manager, and downstream crates (iso-code-mcp) all agree on what counts as “worktree bytes.”
Functions§
- dir_
size_ skipping_ git - Sum the real on-disk size of every file under
roots, skipping any.git/subtree. Hardlinks are deduplicated per-walk by(dev, ino)on Unix. Silently ignores missing roots so callers don’t have to pre-filter. - filesystem_
capacity_ bytes - Return the total capacity in bytes of the filesystem hosting
path. Picks the disk with the longest matching mount-point prefix. ReturnsNonewhen the capacity cannot be determined (e.g. unsupported platform or path outside any known mount), so callers can skip the check.