Skip to content

Commit

Permalink
Fix symlink handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Soltis authored and Greg Soltis committed May 12, 2023
1 parent 8873c50 commit 872d856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/globwalk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn globwalk<'a>(
// we enable following symlinks but only because without it they are ignored
// completely (as opposed to yielded but not followed)

let walker = walkdir::WalkDir::new(base_path.as_path()).follow_links(true);
let walker = walkdir::WalkDir::new(base_path.as_path()).follow_links(false);
let mut iter = walker.into_iter();

let include = include
Expand Down Expand Up @@ -91,7 +91,7 @@ pub fn globwalk<'a>(
};

let relative_path = path.strip_prefix(&base_path).expect("it is a subdir");
let is_directory = path.is_dir();
let is_directory = !path.is_symlink() && path.is_dir();

let include = match do_match_directory(relative_path, &include, &exclude, is_directory) {
Ok(include) => include,
Expand Down

0 comments on commit 872d856

Please sign in to comment.