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
When creating a repo.remote_at("/home/user/repo") with a refspec set to +HEAD:refs/test/repo, the symbolic reference HEAD in the remote repository is not resolved. Instead, the name HEAD is resolved in the local repository, which results in refs/test/repo targeting the local HEAD.
Expected behavior 🤔
The HEAD ref (or any symbolic ref) should be resolved in the remote repository.
Git behavior
Git resolves the HEAD ref in the remote repository.
Steps to reproduce 🕹
Note
This was originally found via Claude Code (Opus 4.7) while developing git-vendor.
The demonstration linked below is originally written by Claude Code, and edited by myself for clarity.
In a scratch space...
cd /tmp
...clone a fork of this repository I've made, and run the demonstration test.
git clone --depth 1 https://github.com/jdc-pub/gitoxide.git --branch main gitoxide-demo
cd gitoxide-demo
git checkout 8ba39778dcc9ca4b95d98e4e1a2a972e68214e1e
cargo test -p gix --features blocking-network-client --test demo-local-transport-symref-failure
You should see the following output. (I've marked the problem-test as should panic, but it of course should not panic!)
running 3 tests
test gix_fetch_head_into_bare_local_is_correct ... ok
test git_cli_fetch_head_returns_upstream_tip ... ok
test gix_fetch_head_resolves_against_local_repo_bug - should panic ... ok
Current behavior 😯
When creating a
repo.remote_at("/home/user/repo")with a refspec set to+HEAD:refs/test/repo, the symbolic referenceHEADin the remote repository is not resolved. Instead, the nameHEADis resolved in the local repository, which results inrefs/test/repotargeting the localHEAD.Expected behavior 🤔
The
HEADref (or any symbolic ref) should be resolved in the remote repository.Git behavior
Git resolves the
HEADref in the remote repository.Steps to reproduce 🕹
Note
This was originally found via Claude Code (Opus 4.7) while developing
git-vendor.The demonstration linked below is originally written by Claude Code, and edited by myself for clarity.
In a scratch space...
cd /tmp...clone a fork of this repository I've made, and run the demonstration test.
You should see the following output. (I've marked the problem-test as
should panic, but it of course should not panic!)