fix(test): preserve POSIX sandbox workspace paths

- Keep remote workspace reset paths POSIX across host platforms.

- Add targeted Windows CI coverage for Sandbox preparation.
This commit is contained in:
Chris Tate
2026-07-28 20:07:34 -05:00
parent dd0a5cf076
commit 124ea659ec
3 changed files with 17 additions and 8 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import { lstatSync } from "node:fs";
import { isAbsolute, parse, resolve, sep } from "node:path";
import { posix, sep } from "node:path";
import { Transform } from "node:stream";
const NUL = Buffer.from([0]);
@@ -59,11 +59,11 @@ export function filterExistingWorktreePaths(root) {
* deleted or renamed in the uploaded worktree cannot survive from the image.
*/
export function workspaceResetCommand(workspaceRoot) {
if (!isAbsolute(workspaceRoot)) {
if (!posix.isAbsolute(workspaceRoot)) {
throw new Error("workspace reset root must be absolute");
}
const normalizedRoot = resolve(workspaceRoot);
if (normalizedRoot === parse(normalizedRoot).root) {
const normalizedRoot = posix.resolve(workspaceRoot);
if (normalizedRoot === posix.parse(normalizedRoot).root) {
throw new Error("refusing to reset a filesystem root");
}
return {