Closed Bouke closed 2 years ago
There are two things that stand out here:
--force-with-lease
?To detect whether a branch is on the server or not, we run:
$ git ls-remote --heads origin <branch names>
We then strip off the remote names and compare that with the local branches.
Could you run the ls-remote
command and report back the result? Anything else unusual or different about this that you can think of for why we might be thinking the branch no longer exists on the server and yet i does?
Yep, if you delete your local copy of the remote ref, then pushing with --force-with-lease
will fail. This is a problem with my git undo
too, since if you delete (or otherwise change the position of) a remote ref, then Git will complain that it's out of sync with the actual remote and abort.
Found the bug! I made the odd assumption that branch names won't have a /
through them and do an rsplit_once('/')
to strip off refs/heads
. Going to go fix it!
Just released v0.5.3 with the fix!
This is working great, thanks!
Description
Currently
git-stack --pull
prunes refs from remotes:This causes
git-stack --push
to fail:To fix this, restore the remote refs:
And
--push
again:Version
0.5.0
Steps to reproduce
No response
Actual Behaviour
No response
Expected Behaviour
No response
Debug Output
No response