Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): checkpoints no longer rehash every file when one entry is skip-worktree or assume-unchanged #23624

Mergedjuliusmarmingemerged 7 commits intomain fromrefs/pull/23624/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 112 additions and 38 deletions.

x
0 of 2 viewed, 2 left
38 additions and 8 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -597,7 +597,17 @@
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
- const driver = yield* GitVcsDriver.makeVcsDriverShape();
+ const liveProcess = yield* VcsProcess.VcsProcess;
+ let freshReadTrees = 0;
+ const driver = yield* GitVcsDriver.makeVcsDriverShape().pipe(
+ Effect.provideService(VcsProcess.VcsProcess, {
+ run: (input) => {
+ if (input.args.includes("read-tree") && input.args.includes("index.sparse=true"))
+ freshReadTrees++;
+ return liveProcess.run(input);
+ },
+ }),
+ );
const cwd = yield* fs.makeTempDirectoryScoped({ prefix: "t3-checkpoint-sparse-" });
const { git } = yield* makeCheckpointFixture(driver, cwd);
const write = Effect.fn(function* (name: string, contents: string) {
@@ -680,11 +690,12 @@
"working outside\n",
+ assert.strictEqual(freshReadTrees, indexState === "missing" ? 2 : 0);
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
​
it.effect.each(
- (["normal", "flags", "sparse"] as const).flatMap((indexMode) =>