Skip to content

av sync needs to provide a better error message when branch can't be deleted due to worktrees #656

@tulioz

Description

@tulioz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions