fix: improve error message when checking out a branch used by another worktree#700
Conversation
Current Aviator status
This PR was merged using Aviator.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
✅ FlexReview StatusCommon Owner:
Review SLO: |
There was a problem hiding this comment.
Code Review
This pull request introduces automated worktree management for the restack sequencer, enabling it to detach and restore branches in external worktrees and skip branches with dirty working trees. The review feedback suggests improving error diagnostics in IsWorktreeClean by capturing stderr and refactoring the sequencer to store worktree preparation messages in its state so they can be properly displayed in the UI rather than being discarded.
… worktree Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d83fb75 to
60e8c42
Compare
|
/aviator merge |
|
Aviator has accepted the merge request. It will enter the queue when all of the required status checks have passed. Aviator will update the sticky status comment as the pull request moves through the queue. |
Summary
CheckoutBranch()fails because the target branch is already checked out in another worktree, detect the git error and return a user-friendly message suggestinggit worktree listandcd <worktree-path>CheckoutBranch():av switch,av next,av prev,av stack foreach, etc.Test plan
go test ./internal/git/...)av switch <branch-checked-out-in-worktree>and verify the improved error message appears🤖 Generated with Claude Code