We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b691572 + a4d86cc commit cb3fad4Copy full SHA for cb3fad4
1 file changed
src/walk.rs
@@ -462,14 +462,20 @@ impl WorkerState {
462
}
463
464
if let Ok(e) = &entry {
465
- let entry_path = e.path();
466
- if entry_path.is_dir()
467
- && config
+ // If the entry is a directory that contains a
+ // "ignore contain" file", we want to skip this
+ // directory.
468
+ // Check the filetype first to avoid unnecessary
469
+ // syscalls.
470
+ if e.file_type().is_some_and(|t| t.is_dir()) {
471
+ let entry_path = e.path();
472
+ if config
473
.ignore_contain
474
.iter()
475
.any(|ic| entry_path.join(ic).exists())
- {
- return WalkState::Skip;
476
+ {
477
+ return WalkState::Skip;
478
+ }
479
480
if e.depth() == 0 {
481
// Skip the root directory entry.
0 commit comments