From 9d64a5fc50fbadceb0bfada3d6b8f993d8863f03 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Sun, 22 Nov 2026 03:13:33 +0000 Subject: [PATCH] test(server): compare Git reconciliation paths across platforms Use portable separators for relative checkout paths. Resolve the expected repository root so a Windows short path does not fail the checkout identity assertion. Co-authored-by: Victor Dozal --- .../src/server/workspace-reconciliation-observation.test.ts | 4 ++-- packages/server/src/utils/checkout-git-identity.test.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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 }); });