Skip to content

Commit 40885df

Browse files
author
Stefan Hoelzl
committed
include dotfiles
1 parent 525e250 commit 40885df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cargo/sources/path.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ impl<'cfg> PathSource<'cfg> {
355355
if !is_root && fs::metadata(&path.join("Cargo.toml")).is_ok() {
356356
return Ok(());
357357
}
358+
// Skip dotfile directories.
359+
if path.file_name().and_then(|s| s.to_str()).map(|s| s.starts_with('.')) == Some(true) {
360+
return Ok(());
361+
}
358362

359363
// For package integration tests, we need to sort the paths in a deterministic order to
360364
// be able to match stdout warnings in the same order.
@@ -368,10 +372,6 @@ impl<'cfg> PathSource<'cfg> {
368372
entries.sort_unstable_by(|a, b| a.as_os_str().cmp(b.as_os_str()));
369373
for path in entries {
370374
let name = path.file_name().and_then(|s| s.to_str());
371-
// Skip dotfile directories.
372-
if name.map(|s| s.starts_with('.')) == Some(true) {
373-
continue;
374-
}
375375
if is_root && name == Some("target") {
376376
// Skip Cargo artifacts.
377377
continue;

0 commit comments

Comments
 (0)