mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 00:03:46 +00:00
test(server): compare Windows workspace identity
This commit is contained in:
@@ -3,6 +3,7 @@ import { mkdtempSync, realpathSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join, resolve } from 'node:path'
|
||||
import { removeHostTree } from '../../src/main/host-tree-removal'
|
||||
import { normalizeRuntimePathForComparison } from '../../src/shared/cross-platform-path'
|
||||
import { decodePairingOffer, type PairingOffer } from '../../src/shared/pairing'
|
||||
import { sendRemoteRuntimeRequest } from '../../src/shared/remote-runtime-client'
|
||||
import type { RuntimeStatus, RuntimeTerminalRead } from '../../src/shared/runtime-types'
|
||||
@@ -219,11 +220,22 @@ async function verifyGitWorkspace(pairing: PairingOffer): Promise<void> {
|
||||
{ repo: `id:${added.repo.id}` }
|
||||
)
|
||||
assert(
|
||||
listed.worktrees.some((worktree) => worktree.path === gitPath),
|
||||
listed.worktrees.some((worktree) => isSameExistingHostPath(worktree.path, gitPath)),
|
||||
'Git worktree unavailable'
|
||||
)
|
||||
}
|
||||
|
||||
function isSameExistingHostPath(left: string, right: string): boolean {
|
||||
try {
|
||||
return (
|
||||
normalizeRuntimePathForComparison(realpathSync.native(left)) ===
|
||||
normalizeRuntimePathForComparison(realpathSync.native(right))
|
||||
)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function verifyFolderWorkspaceAndTerminal(pairing: PairingOffer): Promise<{
|
||||
handle: string
|
||||
marker: string
|
||||
|
||||
Reference in New Issue
Block a user