Merge pull request #1345 from gsd-build/fix/windows-shell-robustness-stdin-projectroot

fix: Windows hook stdin, workflow shell robustness, and project_root detection (#1343)
This commit is contained in:
Tom Boucher
2026-03-23 20:28:31 -04:00
committed by GitHub
25 changed files with 314 additions and 70 deletions

View File

@@ -58,13 +58,15 @@ function findProjectRoot(startDir) {
const root = path.parse(resolved).root;
const homedir = require('os').homedir();
// Check if startDir or any of its ancestors (up to but not including a
// Check if startDir or any of its ancestors (up to AND including the
// candidate project root) contains a .git directory. This handles both
// `backend/` (direct sub-repo) and `backend/src/modules/` (nested inside).
// `backend/` (direct sub-repo) and `backend/src/modules/` (nested inside),
// as well as the common case where .git lives at the same level as .planning/.
function isInsideGitRepo(candidateParent) {
let d = resolved;
while (d !== candidateParent && d !== root) {
while (d !== root) {
if (fs.existsSync(path.join(d, '.git'))) return true;
if (d === candidateParent) break;
d = path.dirname(d);
}
return false;