authorgravatar for 122468993+JonasFocus@users.noreply.github.comJonas B. <122468993+JonasFocus@users.noreply.github.com> 2026-10-11 20:14:09-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-12 01:14:09+00:00
loga5331e4c2c0f0a7b85d912e487f5c97bbce921aa
tree365a9798c605b370a89adcdbd2ff82d5de954232
parent63eaa79242ccb591b7933335cfb758d065952f53
signature Signed by PGP key B5690EEEBB952194

fix(server): checkpoint restore keeps a nested workspace on Windows (#14874)


2 files changed, 5 insertions(+), 1 deletions(-)

apps/server/src/vcs/GitVcsDriver.test.ts+1
......@@ -1049,6 +1049,7 @@ it.effect("restores empty checkpoints without changing paths outside the workspa
10491049 fallbackToHead: false,
10501050 }),
10511051 );
1052 assert.isTrue(yield* fileSystem.exists(cwd));
10521053 assert.isFalse(yield* fileSystem.exists(addedPath));
10531054 }
10541055 yield* fileSystem.writeFileString(
apps/server/src/vcs/GitVcsDriver.ts+4-1
......@@ -1114,7 +1114,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
11141114 });
11151115 }
11161116 // Restoring away the last tracked file can remove a nested workspace directory.
1117 yield* fileSystem.makeDirectory(input.cwd, { recursive: true }).pipe(
1117 const recreateWorkspace = fileSystem.makeDirectory(input.cwd, { recursive: true }).pipe(
11181118 Effect.mapError(
11191119 (cause) =>
11201120 new VcsProcessExitError({
......@@ -1126,6 +1126,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
11261126 }),
11271127 ),
11281128 );
1129 yield* recreateWorkspace;
11291130 const cleaned = yield* execute({
11301131 operation,
11311132 cwd: input.cwd,
......@@ -1150,6 +1151,8 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
11501151 detail: cleaned.stderr.trim() || "Could not clean the checkpoint workspace.",
11511152 });
11521153 }
1154 // On Windows the same clean can remove './' and exit 0.
1155 yield* recreateWorkspace;
11531156
11541157 const headExists = yield* hasHeadCommit(input.cwd);
11551158 if (headExists) {