Open ryan-ph opened 1 week ago
Seems like this is an upstream issue: https://github.com/libgit2/libgit2/issues/6741
Thanks for reporting. It's unfortunate because, as far as I know, we don't actually need or care about the fetch
refspec for the main branch. I think it's hitting this code path and asking for the upstream branch:
And then I guess we're making a Branch
object, which probably involves parsing all the information, not just the upstream branch name.
I only glanced through it, but it's possible that we only need the OID of upstream branch, and not the full branch information. Namely, we might be able to call this function instead:
where we're doing this in sync
:
and then maybe we would avoid hitting the unimplemented libgit2 code path? If you're interested, you could try it to see if it fixes your error.
Thanks for all the code pointers! Will give it a shot when I get some free time (hopefully in the next week)
Description of the bug
Git v2.29.0 supports negative refspecs to allow filtering which refspecs to ignore.
It seems like
git branchless sync --pull
does not currently respect this and will cause panics if a negative refspec is specified in the git config.Example git config specifying a negative refspec for any branches with an underscore prefix
Expected behavior
When running
git branchless sync --pull
, I expect all refs to be fetched from the remote following all git refspec rules (i.e. all refs which match postive refspecs and do not match any negative refspecs), and all local refs to be updated.Actual behavior
A panic:
Version of
rustc
No response
Automated bug report
No response
Version of
git-branchless
git-branchless-opts 0.10.0
Version of
git
git version 2.44.0