Do not remove worktrees after the headless server removal (#19556)

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-10-22 19:27:50 +03:00 committed by GitHub
parent 291ca2c32c
commit edda149d75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 4 deletions

View file

@ -62,6 +62,7 @@ pub struct WorktreeStore {
pub enum WorktreeStoreEvent {
WorktreeAdded(Model<Worktree>),
WorktreeRemoved(EntityId, WorktreeId),
WorktreeReleased(EntityId, WorktreeId),
WorktreeOrderChanged,
WorktreeUpdateSent(Model<Worktree>),
}
@ -394,6 +395,10 @@ impl WorktreeStore {
let handle_id = worktree.entity_id();
cx.observe_release(worktree, move |this, worktree, cx| {
cx.emit(WorktreeStoreEvent::WorktreeReleased(
handle_id,
worktree.id(),
));
cx.emit(WorktreeStoreEvent::WorktreeRemoved(
handle_id,
worktree.id(),