Skip to content

Commit 3e1f62c

Browse files
fix(server): use current host platform for checkpoint long paths
1 parent d4ff6fc commit 3e1f62c

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
type VcsStatusResult,
3333
type WorktreeSubmodules,
3434
} from "@t3tools/contracts";
35-
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
35+
import * as HostProcess from "@t3tools/shared/HostProcess";
3636
import {
3737
makeGitVcsDriverCore,
3838
PATCH_RENDER_PREFIX_ARGS,
@@ -793,12 +793,9 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
793793
"core.fsyncMethod=fsync",
794794
] as const;
795795

796-
// Git for Windows cannot open paths longer than MAX_PATH (260 characters) unless
797-
// core.longpaths is on, and it is off by default. Without it, checkpoint `git add -A` exits
798-
// 128 with "Filename too long" in any workspace holding such a path, and restore cannot write
799-
// or clean those files. Checkpoints only snapshot and restore paths that already exist, so
800-
// commands that touch the working tree turn it on even if the user's config says false.
801-
const longPaths = (yield* HostProcessPlatform) === "win32" ? ["-c", "core.longpaths=true"] : [];
796+
// Checkpoints must handle existing paths beyond Windows MAX_PATH, even when
797+
// core.longpaths is disabled in the user's Git configuration.
798+
const longPaths = (yield* HostProcess.Platform) === "win32" ? ["-c", "core.longpaths=true"] : [];
802799

803800
const checkpoints: VcsDriver.VcsCheckpointOps = {
804801
captureCheckpoint: Effect.fn("GitVcsDriver.checkpoints.captureCheckpoint")(function* (input) {

0 commit comments

Comments
 (0)