Repository navigation
fix(daemon): remove worktrees off the daemon loop - #26
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git worktree removedeletes the whole checkout, including ignored build output (target/,node_modules/). That can take a minute, and until now it ran on the daemon loop, so every client froze for the duration.Changes
daemon/app/worktree_removal.rs):begin_worktree_removal). These find the repo root, refuse the main worktree, check the tree is clean and close the owning session. If any of them fails, the session is left untouched.git worktree removeand branch cleanup (WorktreeRemoval::run). This part never touchesApp.finish_worktree_removalapplies the result. On failure it reopens the closed session, as the old synchronous path did.Command::WorktreeRemovenow gets itsReplywhen the worker finishes, delivered throughfinish_worktree_removalson each loop iteration. Other commands keep being answered in the meantime.Tests
worktree_removal_does_not_block_the_daemon_loop. It checks that a command sent right afterWorktreeRemoveis answered before the removal finishes.cargo build,cargo testandcargo clippyon the whole workspace.Risk
WorktreeRemovenow arrives later, after other events. Any client that expected the reply right away still gets it, just later. The wire protocol is unchanged.