mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-04-24 17:12:16 +02:00
ignore: fix symlink following on Windows
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
This commit is contained in:
parent
c749b604dc
commit
18f549d289
@ -1026,6 +1026,11 @@ impl Work {
|
|||||||
self.dent.is_dir()
|
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.
|
/// Adds ignore rules for parent directories.
|
||||||
///
|
///
|
||||||
/// Note that this only applies to entries at depth 0. On all other
|
/// Note that this only applies to entries at depth 0. On all other
|
||||||
@ -1112,7 +1117,7 @@ impl Worker {
|
|||||||
while let Some(mut work) = self.get_work() {
|
while let Some(mut work) = self.get_work() {
|
||||||
// If the work is not a directory, then we can just execute the
|
// If the work is not a directory, then we can just execute the
|
||||||
// caller's callback immediately and move on.
|
// 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() {
|
if (self.f)(Ok(work.dent)).is_quit() {
|
||||||
self.quit_now();
|
self.quit_now();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user