@devries-cameron20 / t3code Mirror · read-only / commits / 940afd65e0
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 04:30 UTC

fix(server): turn checkpoints keep LF files when core.safecrlf is true (#29826)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 23:28 UTC 940afd65e059078bce26ffd7948c63edf52de5a9
2 files changed +23
apps/server/src/vcs/GitVcsDriver.test.ts
+20
@@ -323,6 +323,26 @@ it.effect("checkpoint capture still fails when a clean filter rejects a file", (
323 }).pipe(Effect.scoped, Effect.provide(layerGitContract)),
324 );
325
326 +it.effect("checkpoint capture keeps LF files that core.safecrlf would refuse to commit", () =>
327 + Effect.gen(function* () {
328 + const fileSystem = yield* FileSystem.FileSystem;
329 + const path = yield* Path.Path;
330 + const driver = yield* GitVcsDriver.makeVcsDriverShape();
331 + const cwd = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-checkpoint-safecrlf-" });
332 + const { git, checkpointRef } = yield* makeCheckpointFixture(driver, cwd);
333 + yield* fileSystem.writeFileString(path.join(cwd, ".gitattributes"), "*.txt text eol=crlf\n");
334 + yield* git(["config", "core.safecrlf", "true"]);
335 + yield* fileSystem.writeFileString(path.join(cwd, "untracked.txt"), "new\n");
336 + const originalIndex = yield* fileSystem.readFile(path.join(cwd, ".git", "index"));
337 +
338 + yield* driver.checkpoints.captureCheckpoint({ cwd, checkpointRef });
339 +
340 + assert.strictEqual((yield* git(["show", `${checkpointRef}:file.txt`])).stdout, "unstaged\n");
341 + assert.strictEqual((yield* git(["show", `${checkpointRef}:untracked.txt`])).stdout, "new\n");
342 + assert.deepEqual(yield* fileSystem.readFile(path.join(cwd, ".git", "index")), originalIndex);
343 + }).pipe(Effect.scoped, Effect.provide(layerGitContract)),
344 +);
345 +
346 it.effect("checkpoint capture refuses a truncated nested repository listing", () =>
347 Effect.gen(function* () {
348 const fs = yield* FileSystem.FileSystem;
apps/server/src/vcs/GitVcsDriver.ts
+3
@@ -1168,6 +1168,9 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
1168 ...indexConfig,
1169 ...durableWrite,
1170 ...longPaths,
1171 + // safecrlf=true refuses LF files under CRLF conversion; capture them as Git's default does.
1172 + "-c",
1173 + "core.safecrlf=false",
1174 "add",
1175 ...(sparseCheckout ? ["--sparse"] : []),
1176 // add -A rejects ignored directories even when they contain tracked files.