You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gracefully handle when branches automatically deleted when PR is merged #1010
Describe the feature or problem you’d like to solve
In our repo we have configured that branches are automatically deleted when a pull request is merged. The new gh pr merge command works great, but it produces a warning:
failed to delete remote branch <my-branch>: http error, 'https://api.github.com/repos/<my-organization>/<my-repo>/git/refs/heads/my-branch failed (422): 'Reference does not exist'
I assume it's because it tried to delete the remote branch, but couldn't find it because GitHub had already deleted it.
Proposed solution
It would be nice if the warning wasn't displayed in this case, so that it doesn't look like anything is wrong.
Additional context
Just in case, I've executed the following commands:
$ gh pr create
$ gh pr merge --squash
Reacted by Ted Behling, Ross, Joongi Kim, Matthew Gabeler-Lee and Mark
Activity
mislav commentedon May 27, 2020
Great catch; thank you for reporting!
Ref. #982
adamchainz commentedon Jun 20, 2020
It's not just a warning, the CLI exits with an error status code.