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, 07:00 UTC
fix(server): turn diffs keep the agent's files when git's diff.relative is on (#28361)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Victor Vogel committed
Nov 1, 2026 at 16:04 UTC
f2527c2c0046047e31611d30ba4761628b5ae143
2 files changed
+18
-2
apps/server/src/checkpointing/CheckpointStore.test.ts
+6
-1
@@ -431,10 +431,11 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
431
]);
432
}),
433
);
434
- it.effect("limits a diff to repository paths from a subdirectory workspace", () =>
434
+ it.effect("reads repository paths from a subdirectory workspace under diff.relative", () =>
435
Effect.gen(function* () {
436
const tmp = yield* makeTmpDir();
437
yield* initRepoWithCommit(tmp);
438
+ yield* git(tmp, ["config", "diff.relative", "true"]);
439
const fileSystem = yield* FileSystem.FileSystem;
440
const cwd = NodePath.join(tmp, "app");
441
yield* fileSystem.makeDirectory(cwd);
@@ -447,6 +448,8 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
448
};
449
yield* checkpointStore.captureCheckpoint({ cwd, checkpointRef: refs.fromCheckpointRef });
450
yield* writeTextFile(NodePath.join(cwd, "kept.txt"), "kept\n");
451
+ yield* git(cwd, ["add", "kept.txt"]);
452
+ yield* git(cwd, ["commit", "-m", "kept"]);
453
yield* writeTextFile(NodePath.join(tmp, "README.md"), "# hidden\n");
454
yield* checkpointStore.captureCheckpoint({ cwd, checkpointRef: refs.toCheckpointRef });
455
@@ -455,8 +458,10 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
458
ignoreWhitespace: false,
459
filePaths: ["app/kept.txt"],
460
});
461
+ expect(patch).toContain("+++ b/app/kept.txt");
462
expect(patch).toContain("+kept");
463
expect(patch).not.toContain("hidden");
464
+ expect(yield* checkpointStore.listAuthoredPaths(refs)).toEqual(new Set(["app/kept.txt"]));
465
}),
466
);
467
});
apps/server/src/vcs/GitVcsDriver.ts
+12
-1
@@ -1374,6 +1374,9 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
1374
operation,
1375
cwd: input.cwd,
1376
args: [
1377
+ // Not --no-relative, which Git before 2.28 rejects.
1378
+ "-c",
1379
+ "diff.relative=false",
1380
"diff",
1381
...(input.format === "numstat" ? ["--numstat", "-z"] : ["--patch"]),
1382
"--no-color",
@@ -1430,7 +1433,15 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
1433
execute({
1434
operation,
1435
cwd: input.cwd,
1433
- args: [...args, "--name-only", "-z", "--no-renames", "--no-ext-diff"],
1436
+ args: [
1437
+ "-c",
1438
+ "diff.relative=false",
1439
+ ...args,
1440
+ "--name-only",
1441
+ "-z",
1442
+ "--no-renames",
1443
+ "--no-ext-diff",
1444
+ ],
1445
maxOutputBytes: VcsDriver.CHECKPOINT_DIFF_MAX_OUTPUT_BYTES,
1446
outputMode: "error",
1447
}).pipe(Effect.map((result) => result.stdout.split("\0")));