Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
regression: Fix a panic when removing git-containing worktree from the project panel (#15256)
CharlesChen08237aa6f4788d8f
diff --git a/crates/project/src/worktree_store.rs b/crates/project/src/worktree_store.rsindex dc1a295194a..fb79b3f8ea3 100644--- a/crates/project/src/worktree_store.rs+++ b/crates/project/src/worktree_store.rs@@ -96,7 +96,15 @@ impl WorktreeStore {pub fn remove_worktree(&mut self, id_to_remove: WorktreeId, cx: &mut ModelContext<Self>) {self.worktrees.retain(|worktree| {if let Some(worktree) = worktree.upgrade() {- worktree.read(cx).id() != id_to_remove+ if worktree.read(cx).id() == id_to_remove {+ cx.emit(WorktreeStoreEvent::WorktreeRemoved(+ worktree.entity_id(),+ id_to_remove,+ ));+ false+ } else {+ true+ }} else {false}