test(server): verify Git trace records without filesystem probes

This commit is contained in:
Mohamed Boudra
2026-10-26 18:05:32 +01:00
parent 32356db309
commit a5f246a18c
2 changed files with 5 additions and 4 deletions
@@ -507,7 +507,6 @@ describe("runGitCommand", () => {
command: "git",
args: ["status", "--short"],
cwd: process.cwd(),
cwdExists: true,
timeout: 30_000,
maxOutputBytes: 20 * 1024 * 1024,
acceptExitCodes: [0, 1],
@@ -520,7 +519,6 @@ describe("runGitCommand", () => {
command: "git",
args: ["status", "--short"],
cwd: process.cwd(),
cwdExists: true,
durationMs: expect.any(Number),
exitCode: 0,
signal: null,
@@ -530,6 +528,9 @@ describe("runGitCommand", () => {
}),
"Git command closed",
);
for (const [record] of trace.mock.calls) {
expect(record).not.toHaveProperty("cwdExists");
}
});
it("rejects non-zero exit codes that are not accepted and frees the slot", async () => {
+2 -2
View File
@@ -1058,12 +1058,12 @@ export async function listPaseoWorktrees({
envOverlay: READ_ONLY_GIT_ENV,
});
const root = projectWorktreesRoot;
const roots = [projectWorktreesRoot, await normalizePathForOwnership(projectWorktreesRoot)];
const worktrees: PaseoWorktreeInfo[] = [];
// Inspect foreign paths sequentially; a large worktree list must not consume the FS pool.
for (const entry of parseWorktreeList(stdout)) {
const path = await normalizePathForOwnership(entry.path);
if ((await getOwnershipRelativePath(root, path)) === null) continue;
if (!roots.some((root) => getRelativePathInsideRoot(root, path) !== null)) continue;
worktrees.push({ ...entry, path, createdAt: await resolveWorktreeCreatedAtIso(path) });
}
return worktrees;