fix(server): checkpoint restore keeps a nested workspace on Windows (#14874)
This commit is contained in:
1 parent
63eaa79242
commit
a5331e4c2c
2 files changed
+5
-1
No files matched your search
@@ -1049,6 +1049,7 @@ it.effect("restores empty checkpoints without changing paths outside the workspa
|
||||
fallbackToHead: false,
|
||||
}),
|
||||
);
|
||||
assert.isTrue(yield* fileSystem.exists(cwd));
|
||||
assert.isFalse(yield* fileSystem.exists(addedPath));
|
||||
}
|
||||
yield* fileSystem.writeFileString(
|
||||
|
||||
@@ -1114,7 +1114,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
|
||||
});
|
||||
}
|
||||
// Restoring away the last tracked file can remove a nested workspace directory.
|
||||
yield* fileSystem.makeDirectory(input.cwd, { recursive: true }).pipe(
|
||||
const recreateWorkspace = fileSystem.makeDirectory(input.cwd, { recursive: true }).pipe(
|
||||
Effect.mapError(
|
||||
(cause) =>
|
||||
new VcsProcessExitError({
|
||||
@@ -1126,6 +1126,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
|
||||
}),
|
||||
),
|
||||
);
|
||||
yield* recreateWorkspace;
|
||||
const cleaned = yield* execute({
|
||||
operation,
|
||||
cwd: input.cwd,
|
||||
@@ -1150,6 +1151,8 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
|
||||
detail: cleaned.stderr.trim() || "Could not clean the checkpoint workspace.",
|
||||
});
|
||||
}
|
||||
// On Windows the same clean can remove './' and exit 0.
|
||||
yield* recreateWorkspace;
|
||||
|
||||
const headExists = yield* hasHeadCommit(input.cwd);
|
||||
if (headExists) {
|
||||
|
||||
Reference in new issue
Block a user