Skip to content

Commit b4b062b

Browse files
saphidclaude
authored andcommitted
fix(server): diffs keep submodule changes under diff.submodule=log
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e0f69e9 commit b4b062b

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎apps/server/src/checkpointing/CheckpointStore.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
159159
yield* initRepoWithCommit(tmp);
160160
yield* git(tmp, ["config", "diff.noprefix", "true"]);
161161
yield* git(tmp, ["config", "diff.suppressBlankEmpty", "true"]);
162+
yield* git(tmp, ["config", "diff.submodule", "log"]);
163+
const sub = NodePath.join(tmp, "sub");
164+
yield* git(tmp, ["init", "sub"]);
165+
yield* initRepoWithCommit(sub);
162166
const checkpointStore = yield* CheckpointStore.CheckpointStore;
163167
const threadId = ThreadId.make("thread-checkpoint-store-noprefix");
164168
const fromCheckpointRef = checkpointRefForThreadTurn(threadId, 0);
@@ -170,6 +174,7 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
170174
checkpointRef: fromCheckpointRef,
171175
});
172176
yield* writeTextFile(NodePath.join(tmp, "README.md"), "# test\n\nafter\n");
177+
yield* git(sub, ["commit", "--allow-empty", "-m", "moved"]);
173178
yield* checkpointStore.captureCheckpoint({
174179
cwd: tmp,
175180
checkpointRef: toCheckpointRef,
@@ -184,6 +189,8 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
184189

185190
expect(diff).toContain("diff --git a/README.md b/README.md");
186191
expect(diff).toContain(" # test\n \n-before\n+after\n");
192+
expect(diff).toContain("diff --git a/sub b/sub");
193+
expect(diff).toContain("+Subproject commit ");
187194
}),
188195
);
189196

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,7 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
14281428
"--no-color",
14291429
"--no-ext-diff",
14301430
"--no-textconv",
1431+
"--submodule=short",
14311432
...PATCH_RENDER_PREFIX_ARGS,
14321433
...(input.ignoreWhitespace ? ["--ignore-all-space"] : []),
14331434
`${fromRevision}^{commit}`,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const REVIEW_BRANCH_SUBJECT_LIMIT = 300;
8181
const REVIEW_BRANCH_COMMIT_MAX_OUTPUT_BYTES = 128 * 1024;
8282
// Client patch parsers require a/ and b/ prefixes; override user diff prefix settings.
8383
export const PATCH_RENDER_PREFIX_ARGS = ["--src-prefix=a/", "--dst-prefix=b/"] as const;
84-
// Client patch parsers drop blank context lines that diff.suppressBlankEmpty prints without a space.
84+
// Client patch parsers drop blank context lines under diff.suppressBlankEmpty and summaries under diff.submodule.
8585
const REVIEW_DIFF_ARGS = [
8686
"-c",
8787
"diff.suppressBlankEmpty=false",
@@ -90,6 +90,7 @@ const REVIEW_DIFF_ARGS = [
9090
"--no-color",
9191
"--no-ext-diff",
9292
"--no-textconv",
93+
"--submodule=short",
9394
...PATCH_RENDER_PREFIX_ARGS,
9495
];
9596
const STATUS_UPSTREAM_REFRESH_INTERVAL = Duration.seconds(15);

0 commit comments

Comments
 (0)