Skip to content

Commit 423c883

Browse files
committed
Inline the temporary Git repo helper at remaining call sites
1 parent b48be00 commit 423c883

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/session/project-key.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ afterEach(async () => {
1919
await rm(root, { recursive: true, force: true });
2020
});
2121

22-
function initGitRepo(dir: string): void {
23-
initTemporaryGitRepo(dir);
24-
}
25-
2622
async function commitReadme(dir: string): Promise<void> {
2723
await writeFile(join(dir, "README"), "x");
2824
execFileSync("git", ["add", "README"], { cwd: dir, stdio: "ignore" });
@@ -37,7 +33,7 @@ test("projectKeyFor is stable across calls for the same path", () => {
3733
});
3834

3935
test("projectKeyFor shares nested dirs under the same git toplevel", async () => {
40-
initGitRepo(root);
36+
initTemporaryGitRepo(root);
4137
await commitReadme(root);
4238

4339
const nested = join(root, "nested", "deep");
@@ -48,7 +44,7 @@ test("projectKeyFor shares nested dirs under the same git toplevel", async () =>
4844
});
4945

5046
test("linked worktrees have distinct project roots and keys from main and each other", async () => {
51-
initGitRepo(root);
47+
initTemporaryGitRepo(root);
5248
await commitReadme(root);
5349

5450
const wtA = join(root, "..", `wt-a-${Date.now()}-${Math.random().toString(16).slice(2)}`);

0 commit comments

Comments
 (0)