fix: address PR review — nested path resolution, sub_repos in init, depth-1 detection

- findProjectRoot: use isInsideGitRepo() to walk up and find .git in
  ancestor dirs, fixing nested paths like backend/src/modules/
- Add sub_repos to cmdInitExecutePhase output so execute-plan.md and
  gsd-executor.md can route commits correctly
- Align new-project.md sub-repo detection to maxdepth 1 matching
  detectSubRepos() behavior
- Add 3 nested path tests for .git heuristic, sub_repos, and multiRepo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Srinivas Koduri
2026-03-18 20:06:49 -07:00
parent 21081dc821
commit d0aae7b63c
4 changed files with 65 additions and 6 deletions

View File

@@ -535,12 +535,12 @@ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "chore: add project
Check for directories with their own `.git` folders (separate repos within the workspace):
```bash
find . -maxdepth 2 -type d -name ".git" -not -path "./.git"
find . -maxdepth 1 -type d -not -name ".*" -not -name "node_modules" -exec test -d "{}/.git" \; -print
```
**If sub-repos found:**
Strip the `/.git` suffix and `./` prefix to get directory names (e.g., `./backend/.git` → `backend`).
Strip the `./` prefix to get directory names (e.g., `./backend` → `backend`).
Use AskUserQuestion:
- header: "Multi-Repo Workspace"