arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.41k stars 83 forks source link

`git submit --forge branch` fails when a remote ref has been deleted #1178

Open arxanas opened 7 months ago

arxanas commented 7 months ago

Description of the bug

  1. Create a remote branch, such as with git submit --create.
  2. Delete the branch on the remote (e.g. Github after merging a pull request).
  3. git submit the same branch, whose remote ref no longer exists.

Expected behavior

Some kind of error message? The rest of the branch pushes should probably succeed, and this one can be reported in a "failed" section. Possibly even the remote branch should be created again or the local branch should be deleted; not sure. (Note that we can tell the difference between a branch that has a remote-tracking branch and a branch that has never been pushed to a remote.)

Actual behavior

When we try to fetch the now-deleted ref, it fails because it has been deleted, and, subsequently, the whole operation fails.

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.8.0

Version of git

git version 2.42.0