Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/shared/src/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ describe("sanitizeFeatureBranchName", () => {
])("keeps the fallback for unprefixed input %s", (input, expected) => {
expect(sanitizeFeatureBranchName(input)).toBe(expected);
});

it("keeps accented letters as their plain letters", () => {
expect(sanitizeFeatureBranchName("fix/Añadir validación del café")).toBe(
"fix/anadir-validacion-del-cafe",
);
});
});

describe("resolveAutoFeatureBranchName", () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/shared/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const TEMP_WORKTREE_BRANCH_PATTERN = new RegExp(

export function sanitizeBranchFragment(raw: string): string {
const normalized = raw
// Fold accented letters to ASCII so "validación" keeps its "o" instead of splitting the word.
.normalize("NFKD")
.replace(/[̀-ͯ]/g, "")
.trim()
.toLowerCase()
.replace(/['"`]/g, "")
Expand Down
Loading