Skip to content

fix: allow @, #, and Unicode in branch names#1043

Open
nikp29 wants to merge 1 commit intoanthropics:mainfrom
nikp29:fix/branch-name-validation-unicode-azure
Open

fix: allow @, #, and Unicode in branch names#1043
nikp29 wants to merge 1 commit intoanthropics:mainfrom
nikp29:fix/branch-name-validation-unicode-azure

Conversation

@nikp29
Copy link

@nikp29 nikp29 commented Mar 11, 2026

Problem

Branch name validation was too restrictive, blocking valid use cases:

  • Azure DevOps integration requires # character (AB#123-description)
  • Some teams use @ in branch names (TICKET@description)
  • Non-ASCII characters (Japanese, etc.) were rejected

Solution

Updated validation regex to allow:

  • @ character (but still block @{ git reflog syntax)
  • # character for Azure DevOps
  • Unicode letters/numbers for internationalization

Added quotes around branch name in git push command to prevent # being interpreted as bash comment.

Security

Quotes (" and ') are still blocked by validation, making shell interpolation safe.

Testing

Added tests for all three new character types.

Fixes

- Allow @ character for common naming patterns (fixes anthropics#998)
- Allow # character for Azure DevOps integration (fixes anthropics#1024)
- Allow Unicode characters for internationalization (fixes anthropics#1020)
- Quote branch name in git push command to prevent # being treated as comment
- Add comprehensive unit and e2e tests

Security: Quotes are still blocked by validation, making shell interpolation safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant