diff --git a/packages/server/src/utils/run-git-command.test.ts b/packages/server/src/utils/run-git-command.test.ts index 32844d0de8..5153b606dc 100644 --- a/packages/server/src/utils/run-git-command.test.ts +++ b/packages/server/src/utils/run-git-command.test.ts @@ -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 () => { diff --git a/packages/server/src/utils/worktree.ts b/packages/server/src/utils/worktree.ts index 66dc3fead3..21f90104c9 100644 --- a/packages/server/src/utils/worktree.ts +++ b/packages/server/src/utils/worktree.ts @@ -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;