From 2687f97a6bf0fc129131a43ef1e79f0cd004db99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=82CHES?= Date: Tue, 17 Mar 2026 17:06:20 -0600 Subject: [PATCH] fix: deduplicate getMainBranch implementations (#994) Co-authored-by: Claude Opus 4.6 (1M context) --- src/resources/extensions/gsd/worktree-command.ts | 3 +-- src/resources/extensions/gsd/worktree-manager.ts | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/resources/extensions/gsd/worktree-command.ts b/src/resources/extensions/gsd/worktree-command.ts index 25fa3c8ab..a498b630f 100644 --- a/src/resources/extensions/gsd/worktree-command.ts +++ b/src/resources/extensions/gsd/worktree-command.ts @@ -12,7 +12,7 @@ import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent"; import { loadPrompt } from "./prompt-loader.js"; -import { autoCommitCurrentBranch } from "./worktree.js"; +import { autoCommitCurrentBranch, getMainBranch } from "./worktree.js"; import { runWorktreePostCreateHook } from "./auto-worktree.js"; import { showConfirm } from "../shared/confirm-ui.js"; import { gsdRoot, milestonesDir } from "./paths.js"; @@ -23,7 +23,6 @@ import { mergeWorktreeToMain, diffWorktreeAll, diffWorktreeNumstat, - getMainBranch, getWorktreeGSDDiff, getWorktreeCodeDiff, getWorktreeLog, diff --git a/src/resources/extensions/gsd/worktree-manager.ts b/src/resources/extensions/gsd/worktree-manager.ts index aa846b5ec..1e894e623 100644 --- a/src/resources/extensions/gsd/worktree-manager.ts +++ b/src/resources/extensions/gsd/worktree-manager.ts @@ -70,10 +70,6 @@ function normalizePathForComparison(path: string): string { return process.platform === "win32" ? normalized.toLowerCase() : normalized; } -export function getMainBranch(basePath: string): string { - return nativeDetectMainBranch(basePath); -} - // ─── resolveGitDir ───────────────────────────────────────────────────────── /**