Skip to content

Commit 0743ba5

Browse files
MarcoDotIOclaudemaria-rcks
authored
fix(shared): branch names keep accented letters as plain letters (#27274)
Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: maria-rcks <[email protected]>
1 parent 6866a2d commit 0743ba5

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎packages/shared/src/git.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ describe("sanitizeFeatureBranchName", () => {
268268
])("keeps the fallback for unprefixed input %s", (input, expected) => {
269269
expect(sanitizeFeatureBranchName(input)).toBe(expected);
270270
});
271+
272+
it("keeps accented letters as their plain letters", () => {
273+
expect(sanitizeFeatureBranchName("fix/Añadir validación del café")).toBe(
274+
"fix/anadir-validacion-del-cafe",
275+
);
276+
});
271277
});
272278

273279
describe("resolveAutoFeatureBranchName", () => {

‎packages/shared/src/git.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const TEMP_WORKTREE_BRANCH_PATTERN = new RegExp(
1919

2020
export function sanitizeBranchFragment(raw: string): string {
2121
const normalized = raw
22+
.normalize("NFKD")
23+
.replace(/[̀-ͯ]/g, "")
2224
.trim()
2325
.toLowerCase()
2426
.replace(/['"`]/g, "")

0 commit comments

Comments
 (0)