Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(checkpoint): fetched upstream commits no longer show as agent changes #25880

ClosedBilalIrfanContact(GitHub profile, opens in a new tab)wants to merge 12 commits intomain fromrefs/pull/25880/headopened View on GitHub

Showing 3 changed files with 177 additions and 0 deletions (loading 1).

x
0 of 3 viewed, 3 left
149 additions and 0 deletionsapps/server/src/checkpointing/CheckpointStore.test.tsModified
View file
@@ -546,6 +546,154 @@
}),
​
+ it.effect("leaves out recent upstream commits that a fetch brought in", () =>
+ Effect.gen(function* () {
+ const tmp = yield* makeTmpDir();
+ const upstream = yield* makeTmpDir("checkpoint-store-upstream-");
+ yield* initRepoWithCommit(tmp);
+ yield* git(upstream, ["clone", tmp, "."]);
+ yield* git(upstream, ["config", "user.email", "test@test.com"]);
+ yield* git(upstream, ["config", "user.name", "Test"]);
+ yield* git(tmp, ["remote", "add", "upstream", upstream]);
+ yield* git(tmp, ["fetch", "upstream"]);
+ const checkpointStore = yield* CheckpointStore.CheckpointStore;
+ const threadId = ThreadId.make("checkpoint-fetched-paths");
+ const refs = {
+ cwd: tmp,
+ fromCheckpointRef: checkpointRefForThreadTurn(threadId, 0),
+ toCheckpointRef: checkpointRefForThreadTurn(threadId, 1),
+ };
+ yield* checkpointStore.captureCheckpoint({
+ cwd: tmp,
+ checkpointRef: refs.fromCheckpointRef,
+ });
+​
+ // Dated after the checkpoint, like an upstream commit pushed during the turn.
+ const afterCheckpoint = "2090-01-01T00:00:00Z";
+ yield* writeTextFile(NodePath.join(upstream, "upstream.txt"), "upstream\n");
+ yield* git(upstream, ["add", "."]);