From e1835cb2213f9a09af04fe8ac7f5ecc7ddee2eb7 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 9 Oct 2025 01:58:37 -0400 Subject: [PATCH] test: ensure snapshot tests run reliably by preventing shared shadow repo state across parallel test execution --- packages/opencode/test/fixture/fixture.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/opencode/test/fixture/fixture.ts b/packages/opencode/test/fixture/fixture.ts index 0b83bb316..3a3e4c0b8 100644 --- a/packages/opencode/test/fixture/fixture.ts +++ b/packages/opencode/test/fixture/fixture.ts @@ -10,7 +10,10 @@ type TmpDirOptions = { export async function tmpdir(options?: TmpDirOptions) { const dirpath = path.join(os.tmpdir(), "opencode-test-" + Math.random().toString(36).slice(2)) await $`mkdir -p ${dirpath}`.quiet() - if (options?.git) await $`git init`.cwd(dirpath).quiet() + if (options?.git) { + await $`git init`.cwd(dirpath).quiet() + await $`git commit --allow-empty -m "root commit ${dirpath}"`.cwd(dirpath).quiet() + } const extra = await options?.init?.(dirpath) const result = { [Symbol.asyncDispose]: async () => {