Skip to content

Commit 972f926

Browse files
saphidclaude
authored andcommitted
fix(server): review rows for nested repositories load in large diffs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 55e2538 commit 972f926

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎apps/server/src/vcs/GitVcsDriverCore.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2083,13 +2083,16 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
20832083
const path = yield* Path.Path;
20842084
const driver = yield* GitVcsDriver.GitVcsDriver;
20852085
const nestedCwd = path.join(cwd, "nested");
2086+
const clone = path.join(nestedCwd, "clone");
2087+
yield* (yield* FileSystem.FileSystem).makeDirectory(clone);
2088+
yield* initRepoWithCommit(clone);
20862089
const preview = yield* driver.getReviewDiffPreview({
20872090
cwd: nestedCwd,
20882091
baseRef: initialBranch,
20892092
});
20902093
assert.equal(
20912094
preview.sources.find((source) => source.kind === "working-tree")!.files!.length,
2092-
2,
2095+
3,
20932096
);
20942097
for (const source of preview.sources) {
20952098
for (const file of source.files ?? []) {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3067,8 +3067,10 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
30673067
),
30683068
);
30693069
if (untracked === null) return null;
3070+
// ls-files lists a nested repository with a trailing slash; its diff path has none.
30703071
const paths = splitNullSeparatedGitStdoutPaths(untracked).filter(
3071-
(candidate) => onlyPath === undefined || candidate === onlyPath,
3072+
(candidate) =>
3073+
onlyPath === undefined || candidate === onlyPath || candidate === `${onlyPath}/`,
30723074
);
30733075
if (paths.length === 0) return { env: undefined };
30743076
if (paths.length > REVIEW_UNTRACKED_MAX_FILES) return null;

0 commit comments

Comments
 (0)