Skip to content

Commit 4117a9e

Browse files
AlbinoGeekclaude
andcommitted
test(roots): use shared gitCmd helper instead of direct execFileSync
Replace direct execFileSync call in gitInitMain with shared gitCmd helper from test-harness. gitCmd automatically sets up test git environment. Remove unused execFileSync import. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent f7f87b5 commit 4117a9e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/server/roots.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@
77
*/
88

99
import { afterEach, describe, expect, test } from "bun:test";
10-
import { execFileSync } from "node:child_process";
1110
import { mkdirSync } from "node:fs";
1211
import { join } from "node:path";
1312

1413
import { registerGitInventoryTool } from "./git-inventory-tool.js";
1514
import { registerGitStatusTool } from "./git-status-tool.js";
16-
import { captureTool, cleanupTmpPaths, mkTmpDir, writeTestGitConfig } from "./test-harness.js";
15+
import {
16+
captureTool,
17+
cleanupTmpPaths,
18+
gitCmd,
19+
mkTmpDir,
20+
writeTestGitConfig,
21+
} from "./test-harness.js";
1722

1823
afterEach(cleanupTmpPaths);
1924

2025
function gitInitMain(dir: string): void {
21-
execFileSync("git", ["init", "-b", "main"], { cwd: dir, stdio: "ignore" });
26+
gitCmd(dir, "init", "-b", "main");
2227
writeTestGitConfig(dir);
2328
}
2429

0 commit comments

Comments
 (0)