Skip to content

Commit 18cc963

Browse files
Use initial branch in cross-repo PR detection test
- Stop hardcoding `main` in `GitCore` integration test setup - Checkout the repo's detected `initialBranch` to keep test behavior stable across default branch names
1 parent 99483cf commit 18cc963

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/server/src/git/Layers/GitCore.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,14 +1591,14 @@ it.layer(TestLayer)("git integration", (it) => {
15911591
const fork = yield* makeTmpDir();
15921592
yield* git(fork, ["init", "--bare"]);
15931593

1594-
yield* initRepoWithCommit(tmp);
1594+
const { initialBranch } = yield* initRepoWithCommit(tmp);
15951595
yield* git(tmp, ["remote", "add", "jasonLaster", fork]);
15961596
yield* git(tmp, ["checkout", "-b", "statemachine"]);
15971597
yield* writeTextFile(path.join(tmp, "fork.txt"), "fork branch\n");
15981598
yield* git(tmp, ["add", "fork.txt"]);
15991599
yield* git(tmp, ["commit", "-m", "fork branch"]);
16001600
yield* git(tmp, ["push", "-u", "jasonLaster", "statemachine"]);
1601-
yield* git(tmp, ["checkout", "main"]);
1601+
yield* git(tmp, ["checkout", initialBranch]);
16021602
yield* git(tmp, ["branch", "-D", "statemachine"]);
16031603
yield* git(tmp, [
16041604
"checkout",

0 commit comments

Comments
 (0)