Skip to content

Commit

Permalink
include dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Hoelzl committed Dec 6, 2019
1 parent 525e250 commit 40885df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cargo/sources/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ impl<'cfg> PathSource<'cfg> {
if !is_root && fs::metadata(&path.join("Cargo.toml")).is_ok() {
return Ok(());
}
// Skip dotfile directories.
if path.file_name().and_then(|s| s.to_str()).map(|s| s.starts_with('.')) == Some(true) {
return Ok(());
}

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

0 comments on commit 40885df

Please sign in to comment.