wt switch --create: leftover-branch hint drops --path, --execute, and trailing args
When wt switch --create fails after git worktree add -b has already written the branch, the WorktreeCreationFailed hint says "to use it, run wt switch <branch>". That suggestion drops the user's other arguments. After wt switch --create feat --path /x -x 'code .', running the hinted wt switch feat creates the worktree at the worktree-path template location instead of /x, and it doesn't run the --execute command.
Why. Other switch hints keep the original flags through SwitchSuggestionCtx. plan_switch errors are wrapped in GitError::WithSwitchSuggestion. WorktreeCreationFailed comes from execute_switch, and its error is returned unwrapped, so the hint is built with suggest_command("switch", &[branch], &[]) and has no context to draw on.
Possible fix. Wrap execute_switch's GitError in WithSwitchSuggestion the same way, and apply ctx in this arm, minus --create, since the branch now exists. Then update the doc near error.rs:1085 that lists which variants use ctx.
Found by reading the code during the nightly survey. I haven't reproduced it. #4705 also adds a hint to failures in the execute_switch path (pre-start), so a fix here should fit with it.
Reproduced and fixed in #4841. The hint now reads e.g. wt switch stranded --path=blocked/stranded --execute='echo hi' -- extra, without --create. WorktreeCreationFailed from execute_switch is now wrapped in WithSwitchSuggestion, through a helper shared with the plan_switch path. A new integration test failed on main and passes with the fix. All checks, including codecov/patch, are green on the PR head. The PR still needs review and a maintainer's merge.