Skip to content

Commit

Permalink
require git init in directory to use git ignore files for filter defi…
Browse files Browse the repository at this point in the history
…nitions
  • Loading branch information
chrissimpkins committed Dec 17, 2023
1 parent f888a22 commit 209d0be
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ pub struct Walker {
impl Walker {
pub fn new(args: &Args) -> Result<Self> {
let mut binding = WalkBuilder::new(&args.path);
let walker = binding.hidden(!args.hidden).skip_stdout(true);
let walker = binding
.hidden(!args.hidden)
.skip_stdout(true)
.require_git(true);

// sort by file path string
if args.name {
Expand Down Expand Up @@ -104,7 +107,10 @@ pub struct ParallelWalker {
impl ParallelWalker {
pub fn new(args: &Args) -> Result<Self> {
let mut binding = WalkBuilder::new(&args.path);
let walker = binding.hidden(!args.hidden).skip_stdout(true);
let walker = binding
.hidden(!args.hidden)
.skip_stdout(true)
.require_git(true);

// filter files on user-defined globs
match &args.glob {
Expand Down

0 comments on commit 209d0be

Please sign in to comment.