Skip to content

fix: preserve original case in branch names#305

Open
mskasa wants to merge 1 commit into
smtg-ai:mainfrom
mskasa:fix/preserve-branch-name-case
Open

fix: preserve original case in branch names#305
mskasa wants to merge 1 commit into
smtg-ai:mainfrom
mskasa:fix/preserve-branch-name-case

Conversation

@mskasa

@mskasa mskasa commented Jun 23, 2026

Copy link
Copy Markdown

Problem

Branch names are silently converted to lowercase by sanitizeBranchName().
For example, entering JRA-123 results in branch jra-123.
This may not match the user's intended naming convention.

According to Atlassian's official documentation, Jira work item keys must use
capital letters to link correctly with development tools:
https://support.atlassian.com/jira-software-cloud/docs/reference-issues-in-your-development-work/

Root Cause

sanitizeBranchName() calls strings.ToLower() and uses a regex that only
allows lowercase letters [^a-z0-9\-_/.], which together silently discard
uppercase characters. The scope of this function could be limited to removing
git-invalid characters, leaving case normalization to the user's preference.

Fix

  • Remove strings.ToLower() call
  • Update regex from [^a-z0-9\-_/.] to [^a-zA-Z0-9\-_/.]
    to allow uppercase letters after removing the lowercasing step

Reproduction

  1. Create a session with name JRA-123
  2. Run git worktree list
  3. Branch name is jra-123 instead of JRA-123

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mskasa

mskasa commented Jun 23, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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