mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-01 20:52:03 -07:00
ignore: partially revert symlink loop check optimization
This optimization wasn't tested too carefully, and it seems to result in a massive amount of file handles open simultaneously. This is likely a result of the parallel iterator, where many directories are being traversed simultaneously. Fixes #648
This commit is contained in:
@@ -1312,7 +1312,10 @@ fn check_symlink_loop(
|
||||
Error::from(err).with_path(child_path).with_depth(child_depth)
|
||||
})?;
|
||||
for ig in ig_parent.parents().take_while(|ig| !ig.is_absolute_parent()) {
|
||||
if ig.handle().map_or(true, |parent| parent == &hchild) {
|
||||
let h = Handle::from_path(ig.path()).map_err(|err| {
|
||||
Error::from(err).with_path(child_path).with_depth(child_depth)
|
||||
})?;
|
||||
if hchild == h {
|
||||
return Err(Error::Loop {
|
||||
ancestor: ig.path().to_path_buf(),
|
||||
child: child_path.to_path_buf(),
|
||||
|
Reference in New Issue
Block a user