Skip to content

Commit

Permalink
Fix non working include-hidden flag (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Jan 4, 2023
1 parent 5d1e3c1 commit 0b21dd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cargo-insta/src/cargo.rs
Expand Up @@ -260,7 +260,9 @@ pub fn find_snapshots<'a>(
) -> impl Iterator<Item = Result<SnapshotContainer, Box<dyn Error>>> + 'a {
let mut builder = WalkBuilder::new(root.clone());
builder.standard_filters(!flags.include_ignored);
if !flags.include_hidden {
if flags.include_hidden {
builder.hidden(false);
} else {
builder.filter_entry(|e| e.file_type().map_or(false, |x| x.is_file()) || !is_hidden(e));
}

Expand Down

0 comments on commit 0b21dd5

Please sign in to comment.