Conversation
Worktree creation failed with "already exists" when a stale directory was left behind from a previous removal. Now both create_worktree and create_worktree_with_start_point check for stale directories and clean them up before running `git worktree add`. Also shuffle ADJECTIVE_STEMS alongside goods so branch names in Phase 2 get a random adjective instead of always starting with "velk". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to spawn When `fire_before_worktree_remove_async` returned an empty vec (hook terminal failed to create), no `PendingWorktreeClose` was registered and the dialog closed silently — leaving the worktree stuck with no removal ever happening. Now the code falls through to the immediate removal path when the deferred hook fails to spawn. Also move `fire_on_worktree_close` before `git worktree remove` in `remove_worktree_project` so the hook runs with a valid CWD instead of a deleted directory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show an error in the dialog instead of silently proceeding. The hook is configured for a reason — if it can't run, the close should stop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bd727ff to
76e643d
Compare
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.
Summary
before_removehook terminal fails to spawn — now shows an error and abortson_worktree_closehook running with a deleted CWDChanges
Stale worktree directory cleanup (
repository.rs)clean_stale_worktree_dir()that checksgit worktree list --porcelainto distinguish active worktrees from stale directoriesgit worktree addcreate_worktreeandcreate_worktree_with_start_pointRandom adjective order (
branch_names.rs)ADJECTIVE_STEMSindices alongside goods indicesClose worktree hook fixes (
close_worktree_dialog.rs,actions/project.rs)fire_before_worktree_remove_asyncreturns empty results (hook terminal failed to create), show error and abort instead of silently closing the dialog with no removalfire_on_worktree_closebeforegit worktree removeinremove_worktree_projectso the hook runs with a valid CWDTest plan
before_removehook, close a worktree — hook should complete before removalbefore_removehook — should show error, not silently skipon_closehook, close a worktree — hook should run with valid CWD