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, .. },