Fix --one-file-system to exclude other-fs-symlink targets with --follow-symlinks

This commit is contained in:
Yorhel 2024-07-12 12:36:17 +02:00
parent 0215f3569d
commit 574a4348a3

View file

@ -479,10 +479,6 @@ fn scanDir(ctx: *Context, pat: *const exclude.Patterns, dir: std.fs.Dir, dir_dev
ctx.addSpecial(.err);
continue;
};
if (main.config.same_fs and ctx.stat.dev != dir_dev) {
ctx.addSpecial(.other_fs);
continue;
}
if (main.config.follow_symlinks and ctx.stat.symlink) {
if (Stat.read(dir, ctx.name, true)) |nstat| {
@ -495,6 +491,10 @@ fn scanDir(ctx: *Context, pat: *const exclude.Patterns, dir: std.fs.Dir, dir_dev
}
} else |_| {}
}
if (main.config.same_fs and ctx.stat.dev != dir_dev) {
ctx.addSpecial(.other_fs);
continue;
}
if (excluded) |e| if (e and ctx.stat.dir) {
ctx.addSpecial(.excluded);
continue;