From 157f791d459a7d2ff4b9ba72089ab7ad19097688 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 17 May 2026 00:36:26 -0400 Subject: [PATCH] fix(windows): derive nested worktree state from show-cdup --- get-shit-done/bin/lib/init.cjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/get-shit-done/bin/lib/init.cjs b/get-shit-done/bin/lib/init.cjs index adc32e587..596268c9d 100644 --- a/get-shit-done/bin/lib/init.cjs +++ b/get-shit-done/bin/lib/init.cjs @@ -98,14 +98,14 @@ function getInitGitState(cwd) { return resolved; }; - // Most reliable signal: git reports a non-empty prefix only when cwd is + // Most reliable signal: git reports non-empty `--show-cdup` only when cwd is // below the worktree root. This avoids short/long path alias issues on Windows. let inNestedSubdir = false; if (info.inside) { try { - const prefixResult = execGit(['rev-parse', '--show-prefix'], { cwd, timeout: 5000 }); - if (prefixResult.exitCode === 0) { - inNestedSubdir = String(prefixResult.stdout || '').trim().length > 0; + const cdupResult = execGit(['rev-parse', '--show-cdup'], { cwd, timeout: 5000 }); + if (cdupResult.exitCode === 0) { + inNestedSubdir = String(cdupResult.stdout || '').trim().length > 0; } else { inNestedSubdir = worktreeRoot !== null; }