1 Commits
Author SHA1 Message Date
sneak 42f8bee633 Walk an operand nested on another filesystem with -x (closes #106)
check / check (push) Canceled after 0s
With -x, an operand under another operand is kept when it is a
directory on a different filesystem than the deepest kept operand
above it, or a regular file in such a directory, because that
operand's walk then does not reach it; it is walked on its own. A
regular file is judged by its directory, since the walk checks
devices only on directories. Below a kept operand, the rule that keeps
the records under a directory -x did not enter applies only to
directories its own walk did not enter, so the records of files gone
from it are deleted.

The new tests stub the devices and share their scan steps with the
test for #99, whose comment no
longer claims it runs every phase. The startWalk comment is rewrapped.

Model: opus-5-5
2026-10-14 18:52:24 +00:00
+3 -1
View File
@@ -244,7 +244,9 @@ func pruneRoots(roots []string, oneFS bool,
// whatever device the file reports, so for a regular-file
// operand its directory decides.
dir := r
if fi, err := os.Lstat(r); err == nil && fi.Mode().IsRegular() {
fi, err := os.Lstat(r)
if err == nil && fi.Mode().IsRegular() {
dir = filepath.Dir(r)
}