Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): skip git status scans while the index is locked #9845

MergedGigioxx(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/9845/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 83 additions and 0 deletions.

x
0 of 2 viewed, 2 left
47 additions and 0 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -11,6 +11,7 @@
import * as Path from "effect/Path";
import * as PlatformError from "effect/PlatformError";
import * as Ref from "effect/Ref";
+import * as Result from "effect/Result";
import * as Scope from "effect/Scope";
import * as Sink from "effect/Sink";
import * as Stream from "effect/Stream";
@@ -131,6 +132,51 @@
return { initialBranch };
});
​
+for (const location of ["root", "nested", "worktree"] as const) {
+ it.effect(
+ `skips clean filters while the ${location} index is locked and resumes after unlock`,
+ () =>
+ Effect.gen(function* () {
+ const driver = yield* GitVcsDriver.GitVcsDriver;
+ const fs = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const repository = yield* makeTmpDir();
+ yield* initRepoWithCommit(repository);
+ const cwd = location === "worktree" ? yield* makeTmpDir() : repository;
+ if (location === "worktree") {
+ yield* git(repository, ["worktree", "add", "--detach", cwd]);
+ }
+ yield* git(cwd, ["config", "filter.probe.clean", "echo clean >> .filter-runs; cat"]);
+ yield* writeTextFile(cwd, ".gitattributes", "asset.bin filter=probe\n");
+ yield* writeTextFile(cwd, ".gitignore", ".filter-runs\n");