Skip to content

fix: allow @ character in branch name validation#999

Open
msyed-godaddy wants to merge 1 commit intoanthropics:mainfrom
msyed-godaddy:fix/allow-at-in-branch-names
Open

fix: allow @ character in branch name validation#999
msyed-godaddy wants to merge 1 commit intoanthropics:mainfrom
msyed-godaddy:fix/allow-at-in-branch-names

Conversation

@msyed-godaddy
Copy link

Summary

  • Updates the branch name validation regex to allow @ in branch names
  • The @ character is valid in git branch names and commonly used in workflows (e.g., TICKET-123@add-feature)
  • The dangerous @{ sequence (git reflog syntax) is already caught by a separate dedicated check, so allowing @ in the whitelist regex is safe
  • Adds test cases for valid branch names containing @

Fixes #998

Test plan

  • All existing tests pass (31 tests, 0 failures)
  • New test cases added for @ in branch names (TICKET-123@add-feature, user@feature-branch, feature@v2)
  • Existing @{ rejection test still passes (caught by the separate @{ check)
  • Manual verification: branch names like TICKET-123@add-feature no longer cause validation errors

🤖 Generated with Claude Code

The branch name validation regex rejected @ characters, but @ is a
valid character in git branch names. Many workflows use @ in branch
names (e.g., TICKET-123@add-feature). The dangerous @{ sequence is
already caught by a separate check, so allowing @ in the whitelist
regex is safe.

Fixes anthropics#998

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ovp87
Copy link

ovp87 commented Mar 3, 2026

very similar to #956

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.

Branch name validation rejects @ character which is valid in git

2 participants