Skip to content

Commit

Permalink
ignore: fix symlink following on Windows
Browse files Browse the repository at this point in the history
This commit fixes a bug where symlinks were always being followed on
Windows, even if the user did not request it. This only impacts the
parallel iterator.

This is a regression from the fallout of fixing #705.

Fixes #824
  • Loading branch information
BurntSushi committed Feb 20, 2018
1 parent c749b60 commit 18f549d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ignore/src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,11 @@ impl Work {
self.dent.is_dir()
}

/// Returns true if and only if this work item is a symlink.
fn is_symlink(&self) -> bool {
self.dent.file_type().map_or(false, |ft| ft.is_symlink())
}

/// Adds ignore rules for parent directories.
///
/// Note that this only applies to entries at depth 0. On all other
Expand Down Expand Up @@ -1112,7 +1117,7 @@ impl Worker {
while let Some(mut work) = self.get_work() {
// If the work is not a directory, then we can just execute the
// caller's callback immediately and move on.
if !work.is_dir() {
if work.is_symlink() || !work.is_dir() {
if (self.f)(Ok(work.dent)).is_quit() {
self.quit_now();
return;
Expand Down

0 comments on commit 18f549d

Please sign in to comment.