diff options
| author | Jesse Vincent <jesse@primeradiant.com> | 2026-09-26 16:02:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-26 16:02:36 -0700 |
| commit | 19e54c094bb69e29fabd3bccb64777d3d1d37e8b (patch) | |
| tree | 04b70229ed4c2c0be7fade336304bc8185f84f97 /tests/claude-code | |
| parent | 8ecf3bb20d63487eb2319ea793a89c7a7e7e0258 (diff) | |
sdd-workspace: leave an existing .superpowers/sdd/.gitignore alone (#2399)
Based on #2161. Also quotes the empty CDPATH so shellcheck passes (SC1007).
Co-authored-by: aruizcu1989 <192807317+aruizcu1989@users.noreply.github.com>
Diffstat (limited to 'tests/claude-code')
| -rwxr-xr-x | tests/claude-code/test-sdd-workspace.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/claude-code/test-sdd-workspace.sh b/tests/claude-code/test-sdd-workspace.sh index 2e8c227..a525bf7 100755 --- a/tests/claude-code/test-sdd-workspace.sh +++ b/tests/claude-code/test-sdd-workspace.sh @@ -350,6 +350,24 @@ PLAN echo " marker: $(cat "$dir_out/plan-path" 2>/dev/null)" fi + # --- A repo's own committed .superpowers/sdd/.gitignore is left alone --- + git init -q -b main "$TEST_ROOT/own-ignore" + local own own_ignore + own="$(cd "$TEST_ROOT/own-ignore" && git rev-parse --show-toplevel)" + own_ignore=$'*\n!.gitignore\n!*/\n!*/progress.md' + mkdir -p "$own/.superpowers/sdd" + printf '%s\n' "$own_ignore" > "$own/.superpowers/sdd/.gitignore" + printf '# Plan\n\n## Task 1: One\n\nOne.\n' > "$own/plan.md" + (cd "$own" && git add -A && git -c user.name=t -c user.email=t@t commit -qm init) + (cd "$own" && "$SDD_SCRIPTS/sdd-workspace" plan.md >/dev/null) + if [[ "$(cat "$own/.superpowers/sdd/.gitignore")" == "$own_ignore" \ + && -z "$(cd "$own" && git status --porcelain -- .superpowers/sdd/.gitignore)" ]]; then + pass "an existing .superpowers/sdd/.gitignore is not overwritten" + else + fail "an existing .superpowers/sdd/.gitignore is not overwritten" + echo " now: $(cat "$own/.superpowers/sdd/.gitignore")" + fi + echo "" if [[ "$FAILURES" -ne 0 ]]; then echo "FAILED: $FAILURES assertion(s)." |
