Skip to content

Commit 2cd19e0

Browse files
committed
🤖 fix: initialize git repos in e2e fixtures
The e2e test fixtures created directories but didn't run git init, causing listBranches() to fail with 'Not a git repository' errors. These errors were logged but didn't fail tests since the tests don't rely on branch-loading functionality. Fix: run 'git init -q' for both projectPath and workspacePath so the fixtures behave like real projects. _Generated with mux_
1 parent 30b1c08 commit 2cd19e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/e2e/utils/demoProject.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from "fs";
22
import path from "path";
3+
import { spawnSync } from "child_process";
34
import { Config } from "../../../src/node/config";
45

56
export interface DemoProjectConfig {
@@ -49,6 +50,10 @@ export function prepareDemoProject(
4950
fs.mkdirSync(workspacePath, { recursive: true });
5051
fs.mkdirSync(sessionsDir, { recursive: true });
5152

53+
// Initialize git repos so listBranches() doesn't error
54+
spawnSync("git", ["init", "-q"], { cwd: projectPath });
55+
spawnSync("git", ["init", "-q"], { cwd: workspacePath });
56+
5257
// E2E tests use legacy workspace ID format to test backward compatibility.
5358
// Production code now uses generateStableId() for new workspaces.
5459
const config = new Config(rootDir);

0 commit comments

Comments
 (0)