Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Don't skip worktree updates if unknown entries are removed
Max Brunsfeld43a94cda5fa4
diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rsindex b1aebf29f10..cbd80def6ca 100644--- a/crates/project/src/worktree.rs+++ b/crates/project/src/worktree.rs@@ -1227,11 +1227,10 @@ impl Snapshot {let mut entries_by_path_edits = Vec::new();let mut entries_by_id_edits = Vec::new();for entry_id in update.removed_entries {- let entry = self- .entry_for_id(ProjectEntryId::from_proto(entry_id))- .ok_or_else(|| anyhow!("unknown entry {}", entry_id))?;- entries_by_path_edits.push(Edit::Remove(PathKey(entry.path.clone())));- entries_by_id_edits.push(Edit::Remove(entry.id));+ if let Some(entry) = self.entry_for_id(ProjectEntryId::from_proto(entry_id)) {+ entries_by_path_edits.push(Edit::Remove(PathKey(entry.path.clone())));+ entries_by_id_edits.push(Edit::Remove(entry.id));+ }}for entry in update.updated_entries {