If you have a branch checked out on a worktree, and that branch has been merged, we attempt to delete the branch and fail with the error:
error: cannot delete merged branch "more_ci_improvements": git branch: exit status 1
❯ git switch more_ci_improvements
fatal: 'more_ci_improvements' is already used by worktree at '/worktrees/pr-feedback'
We should provide a better error message to the user to explain the cause and potentially give advice on how they can recover from this situation.
We should also avoid leaving the user in a detached head state when av sync fails to delete a branch
If you have a branch checked out on a worktree, and that branch has been merged, we attempt to delete the branch and fail with the error:
error: cannot delete merged branch "more_ci_improvements": git branch: exit status 1We should provide a better error message to the user to explain the cause and potentially give advice on how they can recover from this situation.
We should also avoid leaving the user in a detached head state when
av syncfails to delete a branch