I have a project where I have 2 worktrees on the same repo.
I often forget which branch I have checked out in the alternate worktree.
So when I use GitUp to switch branches, sometimes I'll receive the error:
This is fine and expected (if a little more cryptic than the git CLI would print) fatal: '<branch>' is already checked out at '<location>'
However, unfortunately when this happens GitUp also leaves a bunch of erroneously modified files left behind that have to be cleaned up.
These staged changes contain what would be a "revert" against the other branch's HEAD.
A similar issue happens sometimes when a merge fails, or a rebase fails, but its probably the same piece of code.
This behavior does not happen when an attempted checkout fails from the git cli. It just prints the quoted error message and no code is left in a weird state.