fix: normalize Windows 8.3 short paths in worktree test

On Windows CI, fs.realpathSync returns the long path (runneradmin)
while git worktree list returns the 8.3 short path (RUNNER~1).
Apply fs.realpathSync to both sides of the assertion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-03-22 10:34:06 -04:00
parent 5eb3c04bce
commit 918032198a

View File

@@ -1099,8 +1099,11 @@ describe('resolveWorktreeRoot with linked worktree .planning/', () => {
execSync(`git worktree add "${worktreeDir}" -b test-linked-no-plan`, { cwd: mainDir, stdio: 'pipe' });
// resolveWorktreeRoot should return the main repo root
const result = resolveWorktreeRoot(worktreeDir);
assert.strictEqual(result, mainDir,
// Normalize both paths with fs.realpathSync to handle Windows 8.3 short paths
// (e.g., RUNNER~1 vs runneradmin on CI)
const result = fs.realpathSync(resolveWorktreeRoot(worktreeDir));
const expected = fs.realpathSync(mainDir);
assert.strictEqual(result, expected,
'linked worktree without .planning/ should resolve to main repo root');
} finally {
if (worktreeDir) {