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:
@@ -1099,8 +1099,11 @@ describe('resolveWorktreeRoot with linked worktree .planning/', () => {
|
|||||||
execSync(`git worktree add "${worktreeDir}" -b test-linked-no-plan`, { cwd: mainDir, stdio: 'pipe' });
|
execSync(`git worktree add "${worktreeDir}" -b test-linked-no-plan`, { cwd: mainDir, stdio: 'pipe' });
|
||||||
|
|
||||||
// resolveWorktreeRoot should return the main repo root
|
// resolveWorktreeRoot should return the main repo root
|
||||||
const result = resolveWorktreeRoot(worktreeDir);
|
// Normalize both paths with fs.realpathSync to handle Windows 8.3 short paths
|
||||||
assert.strictEqual(result, mainDir,
|
// (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');
|
'linked worktree without .planning/ should resolve to main repo root');
|
||||||
} finally {
|
} finally {
|
||||||
if (worktreeDir) {
|
if (worktreeDir) {
|
||||||
|
|||||||
Reference in New Issue
Block a user