From 25eab8f3686790a2d976307b5e4fe6a54ed571d9 Mon Sep 17 00:00:00 2001 From: deseltrus Date: Mon, 16 Mar 2026 20:13:02 +0100 Subject: [PATCH] test: fix worktree-bugfix tests for CI (git config + Windows compat) Use separate git commands instead of && chains (fails on Windows). Configure git user.name/email before commit (not set in CI runners). Mirrors the pattern from worktree-e2e.test.ts. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../extensions/gsd/tests/worktree-bugfix.test.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/resources/extensions/gsd/tests/worktree-bugfix.test.ts b/src/resources/extensions/gsd/tests/worktree-bugfix.test.ts index 72899a1ce..e0766c065 100644 --- a/src/resources/extensions/gsd/tests/worktree-bugfix.test.ts +++ b/src/resources/extensions/gsd/tests/worktree-bugfix.test.ts @@ -23,8 +23,15 @@ const { assertEq, assertTrue, report } = createTestContext(); // ─── Helpers ────────────────────────────────────────────────────────────── +function run(cmd: string, cwd: string): void { + execSync(cmd, { cwd, stdio: "ignore" }); +} + function initRepo(dir: string): void { - execSync("git init && git commit --allow-empty -m init", { cwd: dir, stdio: "ignore" }); + run("git init", dir); + run("git config user.email test@test.com", dir); + run("git config user.name Test", dir); + run("git commit --allow-empty -m init", dir); } // ─── Tests ──────────────────────────────────────────────────────────────── @@ -94,7 +101,7 @@ describe("worktree-bugfix", () => { mkdirSync(wtPath, { recursive: true }); mkdirSync(join(wtPath, ".gsd", "milestones", "M005"), { recursive: true }); // Initialize git in the worktree so getService doesn't fail - execSync("git init && git commit --allow-empty -m init", { cwd: wtPath, stdio: "ignore" }); + initRepo(wtPath); // captureIntegrationBranch should be a no-op — no META.json written const metaPath = join(wtPath, ".gsd", "milestones", "M005", "M005-META.json");