Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): git status runs in parallel and repo detection spawns 3x fewer git processes #27103

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

Showing 7 changed files with 50 additions and 14 deletions (loading 5).

x
0 of 7 viewed, 7 left
18 additions and 0 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -1006,6 +1006,24 @@
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
+it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
+ "GitVcsDriver detects a repository whose path contains a newline",
+ () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const parent = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-newline-repo-" });
+ const cwd = path.join(parent, "multi\nline");
+ yield* fileSystem.makeDirectory(cwd);
+ yield* runGit(cwd, ["init"]);
+ const driver = yield* GitVcsDriver.makeVcsDriverShape();
+​
+ const repository = yield* driver.detectRepository(cwd);
+ assert.strictEqual(repository?.rootPath, yield* fileSystem.realPath(cwd));
+ assert.strictEqual(repository?.metadataPath, ".git");
+ }).pipe(Effect.scoped, Effect.provide(layerGitContract)),
+);
+​
it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
"GitVcsDriver still fails detection when git exists but cannot be spawned",
() =>
32 additions and 14 deletionsapps/server/src/vcs/GitVcsDriver.tsModified
View file
@@ -587,25 +587,43 @@