From 3eac848d4f6e0cca71a4c5a9b0996827bd7e75c9 Mon Sep 17 00:00:00 2001 From: Kacper Date: Wed, 17 Dec 2025 23:03:29 +0100 Subject: [PATCH] fix: use double quotes for git branch format string on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The git branch --format option needs proper quoting to work cross-platform. Single quotes are preserved literally on Windows, while unquoted format strings may be misinterpreted on Linux. Using double quotes works correctly on both platforms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/server/src/routes/worktree/routes/list-branches.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/server/src/routes/worktree/routes/list-branches.ts b/apps/server/src/routes/worktree/routes/list-branches.ts index 295c8242..0b07eb17 100644 --- a/apps/server/src/routes/worktree/routes/list-branches.ts +++ b/apps/server/src/routes/worktree/routes/list-branches.ts @@ -38,9 +38,10 @@ export function createListBranchesHandler() { const currentBranch = currentBranchOutput.trim(); // List all local branches - // Use %(refname:short) without quotes - quotes are preserved on Windows + // Use double quotes around the format string for cross-platform compatibility + // Single quotes are preserved literally on Windows; double quotes work on both const { stdout: branchesOutput } = await execAsync( - "git branch --format=%(refname:short)", + 'git branch --format="%(refname:short)"', { cwd: worktreePath } );