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, 05:45 UTC
fix(server): review diffs keep working with untracked files outside the sparse cone (#29880)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Alex Southwell committed
Nov 3, 2026 at 23:24 UTC
54223c32e07ffd356e6a48246fa8a33b0fbde087
2 files changed
+24
apps/server/src/vcs/GitVcsDriverCore.test.ts
+21
@@ -2489,6 +2489,27 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2489
}),
2490
);
2491
2492
+ it.effect("reviews untracked files outside the sparse-checkout cone", () =>
2493
+ Effect.gen(function* () {
2494
+ const cwd = yield* makeTmpDir();
2495
+ yield* initRepoWithCommit(cwd);
2496
+ const driver = yield* GitVcsDriver.GitVcsDriver;
2497
+ yield* writeTextFile(cwd, "excluded/tracked.ts", "tracked\n");
2498
+ yield* git(cwd, ["add", "excluded/tracked.ts"]);
2499
+ yield* git(cwd, ["commit", "-m", "add excluded directory"]);
2500
+ yield* git(cwd, ["sparse-checkout", "set", "--cone", "included"]);
2501
+ yield* writeTextFile(cwd, "excluded/new.ts", "outside the cone\n");
2502
+
2503
+ const preview = yield* driver.getReviewDiffPreview({ cwd, ignoreWhitespace: false });
2504
+
2505
+ const source = preview.sources.find((candidate) => candidate.kind === "working-tree")!;
2506
+ assert.deepStrictEqual(source.files, [
2507
+ { path: "excluded/new.ts", previousPath: null, additions: 1, deletions: 0 },
2508
+ ]);
2509
+ assert.include(source.diff, "+outside the cone");
2510
+ }),
2511
+ );
2512
+
2513
it.effect("detects an unstaged rename with edits without mutating a split index", () =>
2514
Effect.gen(function* () {
2515
const cwd = yield* makeTmpDir();
apps/server/src/vcs/GitVcsDriverCore.ts
+3
@@ -3087,6 +3087,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
3087
// Avoid redundant tracked-entry pathspec matching in this disposable index.
3088
"-c",
3089
"core.preloadIndex=false",
3090
+ // Sparse checkout refuses to add untracked files outside the cone, failing the whole review.
3091
+ "-c",
3092
+ "core.sparseCheckout=false",
3093
"--literal-pathspecs",
3094
"add",
3095
"--intent-to-add",