diff --git a/src/git.ts b/src/git.ts index 90b2fef..8190e0d 100644 --- a/src/git.ts +++ b/src/git.ts @@ -131,6 +131,6 @@ export async function hasNewCommits(worktreePath: string): Promise { /** Detect the main branch name (main or master). */ export async function mainBranch(cwd?: string): Promise { const dir = cwd ?? "." - const result = await $`git rev-parse --verify --quiet refs/heads/main`.cwd(dir).nothrow().quiet() + const result = await $`git -C ${dir} rev-parse --verify --quiet refs/heads/main`.nothrow().quiet() return result.exitCode === 0 ? "main" : "master" }