3528 Change `branch` terminal-run commands into normal commands w/ proper error handling
Description
Part 2 including changes to branch delete.
Resolves #3528
Example of error:
Checklist
- [x] I have followed the guidelines in the Contributing document
- [x] My changes follow the coding style of this project
- [x] My changes build without any errors or warnings
- [x] My changes have been formatted and linted
- [x] My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
- [x] My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
- [x] My changes have a descriptive commit message with a short title, including a
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses
@sergiolms Please apply similar changes from https://github.com/gitkraken/vscode-gitlens/pull/3596 to this PR
Now when an error such as unmerged branch happens, we display a prompt to retry it:
We can turn this prompt into something reusable like a confirmation prompt we can parametrize as we find more cases
When attempting to delete a remote branch that no longer exists, I do not get the right error message in the notification area. I get a push error that doesn't describe the issue well: [...] It is true that the operation happening under the hood is
git push -d origin cool-branchbut I expected an error relating to "unable to delete branch because the remote branch was already deleted" or however you have the messaging set up.
True. Since this action is running under git push it wasn't covered by the git branch errors. I added an additional case to git push to handle that case: