Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): reuse Git index metadata during checkpoint capture #10792

Mergedim-kvijay(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/10792/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 237 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
237 additions and 0 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -65,6 +65,243 @@
},
});
​
+const makeCheckpointFixture = Effect.fn("makeCheckpointFixture")(function* (
+ driver: Effect.Success<ReturnType<typeof GitVcsDriver.makeVcsDriverShape>>,
+ cwd: string,
+) {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const git = (args: ReadonlyArray<string>) =>
+ driver.execute({ operation: "checkpoint-test", cwd, args });
+ yield* git(["init"]);
+ yield* git(["config", "user.name", "Test"]);
+ yield* git(["config", "user.email", "test@test.com"]);
+ yield* fileSystem.writeFileString(path.join(cwd, "file.txt"), "initial\n");
+ yield* git(["add", "."]);
+ yield* git(["commit", "-m", "initial"]);
+ const checkpointRef = CheckpointRef.make("refs/t3/checkpoints/test");
+ yield* fileSystem.writeFileString(path.join(cwd, "file.txt"), "staged\n");
+ yield* git(["add", "."]);
+ yield* fileSystem.writeFileString(path.join(cwd, "file.txt"), "unstaged\n");
+ return { git, checkpointRef };
+});
+​
+it.effect("checkpoint capture does not rerun clean filters for unchanged indexed files", () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const driver = yield* GitVcsDriver.makeVcsDriverShape();