Skip to content

Use --foreground in remove-then-switch hint#2040

Merged
max-sixty merged 1 commit intomainfrom
remove-pause
Apr 9, 2026
Merged

Use --foreground in remove-then-switch hint#2040
max-sixty merged 1 commit intomainfrom
remove-pause

Conversation

@max-sixty
Copy link
Copy Markdown
Owner

When wt switch --create X shadows a remote branch, the hint suggested wt remove X && wt switch X to delete the local branch and switch to the remote. Running that chain failed: background removal leaves a placeholder directory at the original path (to keep shell $PWD valid), which then blocks the subsequent switch with "Directory already exists".

--foreground removes the directory synchronously with no placeholder, so the chained switch succeeds.

When `wt switch --create X` shadows a remote branch, the hint suggested
`wt remove X && wt switch X` to delete the local branch and switch to
the remote. Running that suggestion failed: background removal leaves a
placeholder directory at the original path (to keep shell PWD valid),
which then blocks the subsequent switch with "Directory already exists".

`--foreground` removes the directory synchronously with no placeholder,
so the chained switch succeeds.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 814d9fd into main Apr 9, 2026
25 checks passed
@max-sixty max-sixty deleted the remove-pause branch April 9, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants