Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/server/src/vcs/GitVcsDriver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,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(
Expand Down
5 changes: 4 additions & 1 deletion apps/server/src/vcs/GitVcsDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,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({
Expand All @@ -1107,6 +1107,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
}),
),
);
yield* recreateWorkspace;
const cleaned = yield* execute({
operation,
cwd: input.cwd,
Expand All @@ -1131,6 +1132,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) {
Expand Down
Loading