From be29b5fcd71b1e3b8409d655b13dbeb4be71d966 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 20 Feb 2026 07:40:24 -0800 Subject: [PATCH] die more gracefully --- src/git.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" }