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
Branches() silently drops any remote branch whose name ends in /HEAD (e.g. origin/release/HEAD) #225
The intent is to hide the symbolic refs/remotes/<remote>/HEAD. Because the check is a suffix match, it also removes real branches. Git accepts release/HEAD, and any other <x>/HEAD, as a branch name (git check-ref-format --branch release/HEAD succeeds).
Reproduction (git 2.43)
git -C up branch release/HEAD main
git -C down fetch
git -C down branch -r
origin/HEAD -> origin/main
origin/feature
origin/main
origin/release/HEAD <- git lists it
repo.Branches().ExecuteAsync() on down returns:
feature remote=False
main remote=False
origin/feature remote=True
origin/main remote=True <- origin/release/HEAD is missing
A local branch with the same name is kept; only the remote-tracking copy disappears. So RemoteOnly() listings, and any "branches on the server" view, lose it with no error.
Suggested fix
Skip the ref because it is symbolic, not because of how its name ends: add %(symref) to GitOutputFormats.ForEachRefFormat (GitIntegration/Parsing/GitOutputFormats.cs) and skip a remote record when that field is non-empty. This matches git branch -r, which shows origin/HEAD -> origin/main as an alias and lists every real branch normally.
Correct the nearby remark in GitOutputFormats.cs: with :lstrip=2, the HEAD ref shortens to origin/HEAD, not to the bare origin.
Acceptance
A parser test in which refs/remotes/origin/release/HEAD (not symbolic) is returned and refs/remotes/origin/HEAD (symbolic) is not.
An integration test with a remote branch named release/HEAD.
Next step: Add %(symref) to the for-each-ref format, skip a remote record when that field is non-empty instead of matching the name suffix, fix the lstrip=2 remark, and add the parser and integration tests.
Activity
matt-edmondson commentedon Oct 17, 2026
Triage
/HEADare legal but rare. When it happens, the branch silently goes missing from the list.GitBranchParser,GitOutputFormats).%(symref)to the for-each-ref format, skip a remote record when that field is non-empty instead of matching the name suffix, fix thelstrip=2remark, and add the parser and integration tests.Generated by Claude Code