From 5cce23566a9139cc0b4200cbe5bc08c6e7c7b2ca Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sun, 16 Aug 2026 22:32:33 -0700 Subject: [PATCH] Allow manual worktree setup --- scripts/git-hooks/post-checkout.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/git-hooks/post-checkout.mjs b/scripts/git-hooks/post-checkout.mjs index 0f8d21a1..b927b182 100644 --- a/scripts/git-hooks/post-checkout.mjs +++ b/scripts/git-hooks/post-checkout.mjs @@ -17,7 +17,10 @@ import { fileURLToPath } from "url"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const isBranchCheckout = process.argv[4] === "1"; +// Git supplies three arguments when invoking this as a post-checkout hook. When run directly, +// assume the caller wants to configure the current worktree instead of requiring placeholder refs. +const isManualRun = process.argv.length === 2; +const isBranchCheckout = isManualRun || process.argv[4] === "1"; if (!isBranchCheckout) { process.exit(0);