Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): checkpoint capture no longer walks every reflog in the repository #41177

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

Showing 2 changed files with 130 additions and 5 deletions (loading 1).

x
0 of 2 viewed, 2 left
130 additions and 5 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -1427,7 +1427,7 @@
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
-it.effect.each(["local", "mixed", "exit"] as const)(
+it.effect.each(["local", "mixed", "exit", "non-UTF-8 refs", "pruned ref"] as const)(
"checkpoint authorship uses local evidence or full fallback ($0)",
(mode) =>
Effect.gen(function* () {
@@ -1441,7 +1441,7 @@
const fromCheckpointRef = CheckpointRef.make("refs/t3/checkpoints/authorship/from");
const toCheckpointRef = CheckpointRef.make("refs/t3/checkpoints/authorship/to");
yield* driver.checkpoints.captureCheckpoint({ cwd, checkpointRef: fromCheckpointRef });
- if (mode === "mixed") {
+ if (mode !== "local" && mode !== "exit") {
yield* fs.writeFileString(path.join(cwd, "imported.txt"), "upstream\n");
yield* git(["add", "."]);
const tree = (yield* git(["write-tree"])).stdout.trim();
@@ -1476,10 +1476,30 @@
const queryDriver = yield* GitVcsDriver.makeVcsDriverShape().pipe(
Effect.provideService(VcsProcess.VcsProcess, {
run: (input) => {
+ if (mode === "non-UTF-8 refs" && input.args.includes("for-each-ref")) {
+ return liveProcess
+ .run(input)
+ .pipe(Effect.map((result) => ({ ...result, stdoutInvalidUtf8: true })));
+ }
+ // Pruned between listing the refs and walking their reflogs.