From af54a4ffe6d709ae31066ff2c8b189c674633ef7 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 17 May 2026 01:24:45 -0400 Subject: [PATCH] fix(windows): force root-equivalent cwd to non-nested --- get-shit-done/bin/lib/init.cjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/get-shit-done/bin/lib/init.cjs b/get-shit-done/bin/lib/init.cjs index 20e58f54d..10a46792d 100644 --- a/get-shit-done/bin/lib/init.cjs +++ b/get-shit-done/bin/lib/init.cjs @@ -130,6 +130,15 @@ function getInitGitState(cwd) { } } + // Defensive final guard: if git reports the same root path as cwd (after + // slash/case normalization), we are at the worktree root, never nested. + if (inNestedSubdir && typeof worktreeRoot === 'string') { + const toComparableRaw = (p) => p.replace(/\\/g, '/').replace(/\/+$/g, '').toLowerCase(); + if (toComparableRaw(worktreeRoot) === toComparableRaw(String(cwd))) { + inNestedSubdir = false; + } + } + return { has_git: info.inside, git_worktree_root: worktreeRoot,