Skip to content

Commit 468a953

Browse files
K3iraraclaude
andcommitted
test(server): cover the Windows checkpoint recovery command
An unborn nested repository in the long-paths fixture makes the first `git add` fail, so the nested-repo recovery listing now runs and the test checks that it also carries core.longpaths on Windows. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent db2e6c8 commit 468a953

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎apps/server/src/vcs/GitVcsDriver.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,9 @@ it.effect.each(["win32", "linux"] as const)(
11271127
const liveProcess = yield* VcsProcess.VcsProcess;
11281128
const driver = yield* GitVcsDriver.makeVcsDriverShape();
11291129
const cwd = yield* fs.makeTempDirectoryScoped({ prefix: "t3-checkpoint-long-paths-" });
1130-
const { checkpointRef } = yield* makeCheckpointFixture(driver, cwd);
1130+
const { git, checkpointRef } = yield* makeCheckpointFixture(driver, cwd);
1131+
// An unborn nested repository fails the first `add`, so recovery's listing runs too.
1132+
yield* git(["init", "empty"]);
11311133
const observedArgs: ReadonlyArray<string>[] = [];
11321134
const platformDriver = yield* GitVcsDriver.makeVcsDriverShape().pipe(
11331135
Effect.provideService(HostProcessPlatform, platform),
@@ -1144,10 +1146,12 @@ it.effect.each(["win32", "linux"] as const)(
11441146
assert.isTrue(yield* platformDriver.checkpoints.restoreCheckpoint({ cwd, checkpointRef }));
11451147

11461148
assert.strictEqual(yield* fs.readFileString(path.join(cwd, "file.txt")), "unstaged\n");
1149+
assert.strictEqual((yield* git(["ls-tree", checkpointRef, "--", "empty"])).stdout, "");
11471150
const worktreeCommands = observedArgs.filter((args) =>
1148-
["add", "restore", "clean", "reset"].some((command) => args.includes(command)),
1151+
["add", "--others", "restore", "clean", "reset"].some((command) => args.includes(command)),
11491152
);
1150-
assert.strictEqual(worktreeCommands.length, 4);
1153+
// Failed add, recovery listing, retried add, then restore, clean and reset.
1154+
assert.strictEqual(worktreeCommands.length, 6);
11511155
for (const args of worktreeCommands) {
11521156
const setting = args.indexOf("core.longpaths=true");
11531157
if (platform === "win32") assert.strictEqual(args[setting - 1], "-c", args.join(" "));

0 commit comments

Comments
 (0)