diff --git a/apps/server/src/routes/worktree/routes/checkout-branch.ts b/apps/server/src/routes/worktree/routes/checkout-branch.ts index ffa6e5e3..a774a745 100644 --- a/apps/server/src/routes/worktree/routes/checkout-branch.ts +++ b/apps/server/src/routes/worktree/routes/checkout-branch.ts @@ -47,7 +47,7 @@ export function createCheckoutBranchHandler() { } // Get current branch for reference - const { stdout: currentBranchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: currentBranchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); const currentBranch = currentBranchOutput.trim(); diff --git a/apps/server/src/routes/worktree/routes/commit.ts b/apps/server/src/routes/worktree/routes/commit.ts index f33cd94b..ea31de8d 100644 --- a/apps/server/src/routes/worktree/routes/commit.ts +++ b/apps/server/src/routes/worktree/routes/commit.ts @@ -59,7 +59,7 @@ export function createCommitHandler() { const commitHash = hashOutput.trim().substring(0, 8); // Get branch name - const { stdout: branchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: branchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); const branchName = branchOutput.trim(); diff --git a/apps/server/src/routes/worktree/routes/create-pr.ts b/apps/server/src/routes/worktree/routes/create-pr.ts index ec7ba4dd..2e97bca6 100644 --- a/apps/server/src/routes/worktree/routes/create-pr.ts +++ b/apps/server/src/routes/worktree/routes/create-pr.ts @@ -43,7 +43,7 @@ export function createCreatePRHandler() { const effectiveProjectPath = projectPath || worktreePath; // Get current branch name - const { stdout: branchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: branchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, env: execEnv, }); diff --git a/apps/server/src/routes/worktree/routes/delete.ts b/apps/server/src/routes/worktree/routes/delete.ts index 93857f78..3d8ef773 100644 --- a/apps/server/src/routes/worktree/routes/delete.ts +++ b/apps/server/src/routes/worktree/routes/delete.ts @@ -38,7 +38,7 @@ export function createDeleteHandler() { // Get branch name before removing worktree let branchName: string | null = null; try { - const { stdout } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); branchName = stdout.trim(); diff --git a/apps/server/src/routes/worktree/routes/info.ts b/apps/server/src/routes/worktree/routes/info.ts index 3d512452..283957fa 100644 --- a/apps/server/src/routes/worktree/routes/info.ts +++ b/apps/server/src/routes/worktree/routes/info.ts @@ -31,7 +31,7 @@ export function createInfoHandler() { const worktreePath = path.join(projectPath, '.worktrees', featureId); try { await secureFs.access(worktreePath); - const { stdout } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); res.json({ diff --git a/apps/server/src/routes/worktree/routes/list-branches.ts b/apps/server/src/routes/worktree/routes/list-branches.ts index dc7d7d6c..05ff3afc 100644 --- a/apps/server/src/routes/worktree/routes/list-branches.ts +++ b/apps/server/src/routes/worktree/routes/list-branches.ts @@ -34,7 +34,7 @@ export function createListBranchesHandler() { } // Get current branch - const { stdout: currentBranchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: currentBranchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); const currentBranch = currentBranchOutput.trim(); diff --git a/apps/server/src/routes/worktree/routes/merge.ts b/apps/server/src/routes/worktree/routes/merge.ts index ab4e0c17..c44ca4c8 100644 --- a/apps/server/src/routes/worktree/routes/merge.ts +++ b/apps/server/src/routes/worktree/routes/merge.ts @@ -35,7 +35,7 @@ export function createMergeHandler() { const worktreePath = path.join(projectPath, '.worktrees', featureId); // Get current branch - const { stdout: currentBranch } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: currentBranch } = await execAsync('git symbolic-ref --short HEAD', { cwd: projectPath, }); diff --git a/apps/server/src/routes/worktree/routes/pull.ts b/apps/server/src/routes/worktree/routes/pull.ts index 7b922994..b00addba 100644 --- a/apps/server/src/routes/worktree/routes/pull.ts +++ b/apps/server/src/routes/worktree/routes/pull.ts @@ -28,7 +28,7 @@ export function createPullHandler() { } // Get current branch name - const { stdout: branchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: branchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); const branchName = branchOutput.trim(); diff --git a/apps/server/src/routes/worktree/routes/push.ts b/apps/server/src/routes/worktree/routes/push.ts index b044ba00..2b8ccb90 100644 --- a/apps/server/src/routes/worktree/routes/push.ts +++ b/apps/server/src/routes/worktree/routes/push.ts @@ -29,7 +29,7 @@ export function createPushHandler() { } // Get branch name - const { stdout: branchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: branchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); const branchName = branchOutput.trim(); diff --git a/apps/server/src/routes/worktree/routes/switch-branch.ts b/apps/server/src/routes/worktree/routes/switch-branch.ts index d087341b..36be8d2c 100644 --- a/apps/server/src/routes/worktree/routes/switch-branch.ts +++ b/apps/server/src/routes/worktree/routes/switch-branch.ts @@ -87,7 +87,7 @@ export function createSwitchBranchHandler() { } // Get current branch - const { stdout: currentBranchOutput } = await execAsync('git rev-parse --abbrev-ref HEAD', { + const { stdout: currentBranchOutput } = await execAsync('git symbolic-ref --short HEAD', { cwd: worktreePath, }); const previousBranch = currentBranchOutput.trim();