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
Branch patterns ? and [...] disagree with git branch --list on non-ASCII names: origin/? matches origin/é here but not in git #115
The README says branch patterns mean what they mean to git branch --list. But BranchPattern (MatchesOne / TryWalkBracket in Refs/BranchPattern.cs) matches on UTF-16 chars, while git's wildmatch matches on bytes. Any branch name outside ASCII therefore gets a different answer.
Observed differences
I compared BranchPattern with git branch -r --list over 43 patterns and 37 real refs:
Pattern
Ref
git
BranchPattern
origin/?
origin/é
no match (é is 2 bytes)
match
origin/[é]
origin/é
no match
match
origin/caf??
origin/café
match
no match
? / [...] against an emoji
—
counts 4 bytes
counts 2 UTF-16 units
Every ASCII-only pattern agreed.
Why it matters
A client that tests a pattern with git branch --list and then sends it here gets a different branch set. Its /state answer quietly leaves out branches it expected, or includes branches it didn't. This affects any team whose branch names contain accented letters or emoji.
Suggested fix
Match against the UTF-8 bytes of the pattern and the ref name, the way git's wildmatch does. That gives exact parity, including git's own byte-level behaviour for ? on multi-byte characters.
If byte-level ? is judged too surprising to copy, the README should instead state the deviation explicitly (code-point matching). As it stands, the README promises parity and the code doesn't deliver it.
Acceptance criteria
A parity test runs the cases above (and the existing ASCII cases) through both BranchPattern and git branch --list against the same refs, and they agree.
Category: Bug (the README promises parity with git branch --list, and the code doesn't match it)
Priority: Medium. Only branch names outside ASCII are affected, and the result is a branch set that is silently wrong rather than an outage. ASCII patterns all agree.
Activity
matt-edmondson commentedon Nov 1, 2026
Triage
git branch --list, and the code doesn't match it)Refs/BranchPattern.cs(MatchesOne/TryWalkBracket). Either match on UTF-8 bytes like git's wildmatch, or document code-point semantics in the README. Keep the Branch patterns with[...]character classes match no branches, though git'sbranch --listhonours them #43 / Branch patterns with POSIX character classes like [[:digit:]] silently match the wrong branches #56 bracket and POSIX-class behaviour unchanged.Generated by Claude Code