summaryrefslogtreecommitdiff
path: root/tests/claude-code
diff options
context:
space:
mode:
authorJesse Vincent <jesse@primeradiant.com>2026-06-17 13:29:15 -0700
committerDrew Ritter <drew@ritter.dev>2026-06-18 15:44:22 -0700
commit667b2c4a2ebdece5377cfe1040da4bb4a3744419 (patch)
tree4932ebbe3cf8a00c98d2cd1630e88f1215b3c2f5 /tests/claude-code
parent93b8444b51aeae2e1a8ad9a97124ef6ca528b533 (diff)
test(sdd): lock in per-worktree workspace isolation (#1780)
Diffstat (limited to 'tests/claude-code')
-rwxr-xr-xtests/claude-code/test-sdd-workspace.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/claude-code/test-sdd-workspace.sh b/tests/claude-code/test-sdd-workspace.sh
index d367f14..397e1eb 100755
--- a/tests/claude-code/test-sdd-workspace.sh
+++ b/tests/claude-code/test-sdd-workspace.sh
@@ -107,6 +107,30 @@ PLAN
;;
esac
+ # --- Worktree isolation: a linked worktree resolves its own workspace ---
+ local wt="$TEST_ROOT/wt"
+ ( cd "$repo" && git worktree add -q "$wt" -b wt-feature )
+ local wt_root wt_dir
+ wt_root="$(cd "$wt" && git rev-parse --show-toplevel)"
+ wt_dir="$(cd "$wt" && "$SDD_SCRIPTS/sdd-workspace")"
+ if [[ "$wt_dir" == "$wt_root/.superpowers/sdd" && "$wt_dir" != "$dir" ]]; then
+ pass "linked worktree resolves its own distinct workspace"
+ else
+ fail "linked worktree resolves its own distinct workspace"
+ echo " main: $dir"
+ echo " wt: $wt_dir"
+ fi
+
+ printf 'y\n' > "$wt/.superpowers/sdd/artifact.md"
+ local wt_status
+ wt_status="$(cd "$wt" && git status --porcelain)"
+ if [[ -z "$wt_status" ]]; then
+ pass "worktree workspace invisible to git status"
+ else
+ fail "worktree workspace invisible to git status"
+ echo " status: $wt_status"
+ fi
+
echo ""
if [[ "$FAILURES" -ne 0 ]]; then
echo "FAILED: $FAILURES assertion(s)."