Clear descendants of existing children when scanning a directory

Antonio Scandurra , Max Brunsfeld , and Nathan Sobo created

Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

zed/src/worktree.rs | 2 ++
1 file changed, 2 insertions(+)

Detailed changes

zed/src/worktree.rs 🔗

@@ -403,6 +403,8 @@ impl Snapshot {
                             .insert(child.inode());
                     }
                 }
+
+                self.clear_descendants(child.inode(), &mut edits);
             }
             edits.push(Edit::Insert(child));
         }