Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42f8bee633 |
@@ -522,10 +522,9 @@ Rules for the walk:
|
||||
- Filesystem boundaries are crossed by default. With `-x` (long form
|
||||
`--one-file-system`, following the GNU `du`/`rsync` convention), never descend
|
||||
into a directory on a different filesystem than its `PATH` operand; each
|
||||
operand is bounded by its own filesystem. The records below such a directory,
|
||||
unless they lie below an operand at or inside that directory, count as outside
|
||||
the scanned operands, as described in "`scan` mode" above: they are not
|
||||
deleted, and their sizes join the size census.
|
||||
operand is bounded by its own filesystem. The records below such a directory
|
||||
count as outside the scanned operands, as described in "`scan` mode" above:
|
||||
they are not deleted, and their sizes join the size census.
|
||||
- On any per-path error (permission denied, file vanished between passes,
|
||||
unreadable): print a one-line warning to stderr, skip the path, and continue.
|
||||
Per-file errors never abort the run; the final summary reports how many were
|
||||
|
||||
@@ -1334,38 +1334,6 @@ func TestScanOneFilesystemRecordsNestedFileOnce(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestScanOneFilesystemWalksNestedFileOperand checks that with -x a
|
||||
// regular-file operand under another operand is kept when its directory
|
||||
// is on a different filesystem than that operand: the walk of the other
|
||||
// operand does not enter the directory, so the file is recorded once,
|
||||
// as its own operand. The other operand is given a device that no
|
||||
// directory here is on.
|
||||
func TestScanOneFilesystemWalksNestedFileOperand(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dir := t.TempDir()
|
||||
db := openTestDB(t)
|
||||
file := writeFile(t, dir, "sub/f", pattern(1, 10))
|
||||
|
||||
info, err := os.Lstat(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
dev, ok := deviceOfInfo(info)
|
||||
if !ok {
|
||||
t.Skip("platform exposes no device id")
|
||||
}
|
||||
|
||||
st := syncOneFilesystem(t, db, []string{dir, file}, map[string]uint64{
|
||||
dir: dev + 1, filepath.Dir(file): dev,
|
||||
})
|
||||
|
||||
if st.added != 1 {
|
||||
t.Errorf("%s recorded %d times, want once", file, st.added)
|
||||
}
|
||||
}
|
||||
|
||||
// buildSmokeTree recreates the README smoke-test filesystem layout
|
||||
// with deterministic content and returns the tree root.
|
||||
func buildSmokeTree(t *testing.T) string {
|
||||
|
||||
Reference in New Issue
Block a user