diff --git a/packages/server/src/server/workspace-reconciliation-observation.test.ts b/packages/server/src/server/workspace-reconciliation-observation.test.ts index c40b4b2ca7..98817c61e8 100644 --- a/packages/server/src/server/workspace-reconciliation-observation.test.ts +++ b/packages/server/src/server/workspace-reconciliation-observation.test.ts @@ -325,7 +325,7 @@ class ObservedPlacements { return this.checkoutReadCount; } - /** Home-relative directories read since the last call, sorted. */ + /** Home-relative directories read since the last call, with portable separators. */ takeCheckoutReads(): string[] { return this.checkoutReadCwds.splice(0).sort(); } @@ -376,7 +376,7 @@ class ObservedPlacements { private async readCheckout(cwd: string): Promise { this.checkoutReadCount += 1; - this.checkoutReadCwds.push(path.relative(this.home, cwd)); + this.checkoutReadCwds.push(path.relative(this.home, cwd).split(path.sep).join("/")); const configured = [...this.checkoutByCwd.entries()].find(([root]) => areEquivalentPaths(root, cwd), )?.[1]; diff --git a/packages/server/src/utils/checkout-git-identity.test.ts b/packages/server/src/utils/checkout-git-identity.test.ts index 7f2ccb1799..2e11877ba6 100644 --- a/packages/server/src/utils/checkout-git-identity.test.ts +++ b/packages/server/src/utils/checkout-git-identity.test.ts @@ -1,5 +1,6 @@ import { execFileSync } from "node:child_process"; import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs"; +import { realpath } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; @@ -61,13 +62,14 @@ describe("getCheckoutIdentity", () => { isPaseoOwnedWorktree: status.isPaseoOwnedWorktree, }); } + const mainRepoRoot = await realpath(repoDir); expect(await getCheckoutIdentity(linkedDir, { paseoHome })).toMatchObject({ currentBranch: "feature", - mainRepoRoot: repoDir, + mainRepoRoot, }); expect(await getCheckoutIdentity(paseoWorktree.worktreePath, { paseoHome })).toMatchObject({ isPaseoOwnedWorktree: true, - mainRepoRoot: repoDir, + mainRepoRoot, }); expect(await getCheckoutIdentity(plainDir, { paseoHome })).toEqual({ isGit: false }); });