Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/36332/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 122 additions and 10 deletions.

x
0 of 2 viewed, 2 left
51 additions and 0 deletionsapps/server/src/checkpointing/CheckpointStore.test.tsModified
View file
@@ -546,6 +546,57 @@
}),
​
+ it.effect("leaves out fetched commits newer than the checkpoint, keeping local ones", () =>
+ Effect.gen(function* () {
+ const root = yield* makeTmpDir();
+ const upstream = NodePath.join(root, "upstream");
+ const primary = NodePath.join(root, "primary");
+ const cwd = NodePath.join(root, "turn");
+ yield* (yield* FileSystem.FileSystem).makeDirectory(upstream);
+ yield* initRepoWithCommit(upstream);
+ yield* git(root, ["clone", upstream, primary]);
+ yield* git(primary, ["config", "user.email", "test@test.com"]);
+ yield* git(primary, ["config", "user.name", "Test"]);
+ yield* git(primary, ["worktree", "add", cwd, "-b", "turn"]);
+ const checkpointStore = yield* CheckpointStore.CheckpointStore;
+ const threadId = ThreadId.make("checkpoint-authored-paths-fetched");
+ const refs = {
+ cwd,
+ fromCheckpointRef: checkpointRefForThreadTurn(threadId, 0),
+ toCheckpointRef: checkpointRefForThreadTurn(threadId, 1),
+ };
+ yield* checkpointStore.captureCheckpoint({ cwd, checkpointRef: refs.fromCheckpointRef });
+​
+ const commitFile = (repo: string, file: string) =>
+ Effect.gen(function* () {
+ yield* writeTextFile(NodePath.join(repo, file), `${file}\n`);
+ yield* git(repo, ["add", "."]);
+ yield* git(repo, ["commit", "-m", file]);