From 51357f06220b45a924e3c32bbdaadfd121a34ed5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 16 Jan 2026 18:58:56 +0000 Subject: [PATCH] fix(cli): correct log message for workspace fork branches Use rawGitBranch instead of currentBranch in the log message when showing the origin of a workspace fork branch. Co-Authored-By: Claude Opus 4.5 --- cli/src/core/conf.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/src/core/conf.ts b/cli/src/core/conf.ts index f5b95f90ce..52f5e2dd86 100644 --- a/cli/src/core/conf.ts +++ b/cli/src/core/conf.ts @@ -497,6 +497,7 @@ export async function getEffectiveSettings( // Determine the branch to use: branchOverride takes precedence, then git detection let currentBranch: string | null = null; let originalBranchIfForked: string | null = null; + let rawGitBranch: string | null = null; if (branchOverride) { currentBranch = branchOverride; @@ -504,8 +505,8 @@ export async function getEffectiveSettings( log.info(`Using branch override: ${branchOverride}`); } } else if (isGitRepository()) { - const branch = getCurrentGitBranch(); - originalBranchIfForked = getOriginalBranchForWorkspaceForks(branch); + rawGitBranch = getCurrentGitBranch(); + originalBranchIfForked = getOriginalBranchForWorkspaceForks(rawGitBranch); if (originalBranchIfForked) { log.info( @@ -513,7 +514,7 @@ export async function getEffectiveSettings( ); currentBranch = originalBranchIfForked; } else { - currentBranch = branch; + currentBranch = rawGitBranch; } } else { log.debug("Not in a Git repository and no branch override provided, using top-level settings"); @@ -552,7 +553,7 @@ export async function getEffectiveSettings( Object.assign(effective, gitBranches[currentBranch].overrides); if (!suppressLogs) { const extraLog = originalBranchIfForked - ? ` (because it is the origin of the workspace fork branch \`${currentBranch}\`)` + ? ` (because it is the origin of the workspace fork branch \`${rawGitBranch}\`)` : ""; log.info( `Applied settings for Git branch: ${currentBranch}${extraLog}`