authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-01 15:53:44-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-01 20:06:01-08:00
log8cd92150b13a9b129b8d5cb26f91444d60ea6f55
treee96a8eab3b9d75f3376de50ffda6fa79e7fb5c78
parentd0ab35931e90972d4217f319645a36601a1748bf

test: use dynamic default branch in remote-base-ahead case

Co-authored-by: codex <codex@users.noreply.github.com>

1 files changed, 9 insertions(+), 3 deletions(-)

apps/server/src/git/Layers/GitCore.test.ts+9-3
...@@ -1170,13 +1170,19 @@ it.layer(TestLayer)("git integration", (it) => {...@@ -1170,13 +1170,19 @@ it.layer(TestLayer)("git integration", (it) => {
1170 yield* git(remote, ["init", "--bare"]);1170 yield* git(remote, ["init", "--bare"]);
11711171
1172 yield* initRepoWithCommit(source);1172 yield* initRepoWithCommit(source);
1173 const initialBranch = (yield* listGitBranches({ cwd: source })).branches.find(
1174 (branch) => branch.current,
1175 )!.name;
1173 yield* git(source, ["remote", "add", "origin", remote]);1176 yield* git(source, ["remote", "add", "origin", remote]);
1174 yield* git(source, ["push", "-u", "origin", "main"]);1177 yield* git(source, ["push", "-u", "origin", initialBranch]);
1175 yield* git(source, ["checkout", "-b", "feature/remote-base-only"]);1178 yield* git(source, ["checkout", "-b", "feature/remote-base-only"]);
1176 yield* writeTextFile(path.join(source, "feature.txt"), "ahead of origin/main\n");1179 yield* writeTextFile(
1180 path.join(source, "feature.txt"),
1181 `ahead of origin/${initialBranch}\n`,
1182 );
1177 yield* git(source, ["add", "feature.txt"]);1183 yield* git(source, ["add", "feature.txt"]);
1178 yield* git(source, ["commit", "-m", "feature commit"]);1184 yield* git(source, ["commit", "-m", "feature commit"]);
1179 yield* git(source, ["branch", "-D", "main"]);1185 yield* git(source, ["branch", "-D", initialBranch]);
11801186
1181 const core = yield* GitCore;1187 const core = yield* GitCore;
1182 const details = yield* core.statusDetails(source);1188 const details = yield* core.statusDetails(source);