summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Nguyen <benjamin.van.nguyen@gmail.com>2023-12-02 14:15:15 -0800
committerBenjamin Nguyen <benjamin.van.nguyen@gmail.com>2023-12-02 14:15:15 -0800
commit573838b4d5bf30f44e5ce23b847bfa1e6d2243b5 (patch)
treefb107db93465c251cbedd9968d2a015ecfd03404
parentf55bd00c2deea3311394a35396fc2574015a4853 (diff)
don't prune removed nodes
-rw-r--r--src/file/tree/filter.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/file/tree/filter.rs b/src/file/tree/filter.rs
index 55d53a0..0410159 100644
--- a/src/file/tree/filter.rs
+++ b/src/file/tree/filter.rs
@@ -55,8 +55,8 @@ impl Tree {
while pruning {
let mut to_remove = vec![];
- for n in self.root_id.descendants(&self.arena) {
- if self.arena[n].get().is_dir() && n.children(&self.arena).count() == 0 {
+ for n in self.root_id.descendants(&self.arena).skip(1) {
+ if !n.is_removed(&self.arena) && self.arena[n].get().is_dir() && n.children(&self.arena).count() == 0 {
to_remove.push(n);
}
}
@@ -168,6 +168,7 @@ impl Tree {
Ok(())
}
+ /// Filtering via globbing
fn filter_glob(&mut self, ctx: &Context) -> Result<()> {
let Context {
globbing: Globbing { iglob, .. },