Skip to content

Commit 5815442

Browse files
saphidclaude
andauthored
fix(server): turn diffs keep signed commits' files under log.showSignature (pingdotgg#29124)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 064cf8f commit 5815442

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,5 +522,40 @@ it.layer(layerTest)("CheckpointStore.layer", (it) => {
522522
);
523523
}),
524524
);
525+
526+
it.effect("keeps paths from signed commits under log.showSignature", () =>
527+
Effect.gen(function* () {
528+
const tmp = yield* makeTmpDir();
529+
yield* initRepoWithCommit(tmp);
530+
const signingKey = NodePath.join(yield* makeTmpDir("checkpoint-signing-key-"), "key");
531+
yield* (yield* VcsProcess.VcsProcess).run({
532+
operation: "CheckpointStore.test.sshKeygen",
533+
command: "ssh-keygen",
534+
cwd: tmp,
535+
args: ["-q", "-t", "ed25519", "-N", "", "-f", signingKey],
536+
timeoutMs: 10_000,
537+
});
538+
yield* git(tmp, ["config", "gpg.format", "ssh"]);
539+
yield* git(tmp, ["config", "user.signingkey", `${signingKey}.pub`]);
540+
yield* git(tmp, ["config", "log.showSignature", "true"]);
541+
const checkpointStore = yield* CheckpointStore.CheckpointStore;
542+
const threadId = ThreadId.make("checkpoint-authored-paths-signed");
543+
const refs = {
544+
cwd: tmp,
545+
fromCheckpointRef: checkpointRefForThreadTurn(threadId, 0),
546+
toCheckpointRef: checkpointRefForThreadTurn(threadId, 1),
547+
};
548+
yield* checkpointStore.captureCheckpoint({
549+
cwd: tmp,
550+
checkpointRef: refs.fromCheckpointRef,
551+
});
552+
yield* writeTextFile(NodePath.join(tmp, "kept.txt"), "kept\n");
553+
yield* git(tmp, ["add", "kept.txt"]);
554+
yield* git(tmp, ["commit", "-S", "-m", "kept"]);
555+
yield* checkpointStore.captureCheckpoint({ cwd: tmp, checkpointRef: refs.toCheckpointRef });
556+
557+
expect(yield* checkpointStore.listAuthoredPaths(refs)).toEqual(new Set(["kept.txt"]));
558+
}),
559+
);
525560
});
526561
});

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,9 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
14361436
args: [
14371437
"-c",
14381438
"diff.relative=false",
1439+
// log.showSignature prints verification text into the path list.
1440+
"-c",
1441+
"log.showSignature=false",
14391442
...args,
14401443
"--name-only",
14411444
"-z",

0 commit comments

Comments
 (0)