{{ message }}
Commit 3f14ff4
fix(powershell): stop create-new-feature crashing on a non-Latin description (#4138)
Get-BranchName's fallback assumed the pipeline yields at least one element:
$fallbackWords = ($result -split '-') | Where-Object { $_ } | ...
return [string]::Join('-', $fallbackWords)
ConvertTo-CleanBranchName blanks every non-[a-z0-9] character, so a
description written in any non-Latin script leaves nothing for the pipeline
to emit. It yields $null, [string]::Join throws ArgumentNullException, and
$ErrorActionPreference = 'Stop' makes that terminating — the script dies
with a .NET stack trace, empty stdout, exit 1.
Measured with all three twins installed in one project:
desc='добавить авторизацию'
bash rc=0 BRANCH_NAME='001-'
py rc=0 BRANCH_NAME='001-'
ps rc=1 Exception calling "Join" ...
Identical for 添加用户认证 and '!!! ??? ***'. This hits every PowerShell
user who phrases a feature in their own language.
Wrap the pipeline in @() so it stays an array; Join on an empty array
returns "", matching the twins. Verified the normal case is unchanged
('a-to-the-of' -> 'a-to-the', 'add user authentication' ->
'001-user-authentication'), and the file stays ASCII-only (0 non-ASCII
bytes) for tests/test_ps1_encoding.py.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent cc505da commit 3f14ff4
2 files changed
Lines changed: 61 additions & 1 deletion

0 commit comments