Files
orca/src/main/github/github-api-repository-probe.ts
T
OrcaWinandm4air c5224f70d8 refactor(providers): delete the SSH git and filesystem providers and relay-only wiring (#27644)
* refactor(providers): delete the SSH git and filesystem providers and relay-only wiring

* refactor(ssh): drop relay-protocol exports only the deleted stream readers used

---------

Co-authored-by: m4air <m4air@Mac.localdomain>
2026-10-11 17:48:43 -07:00

25 lines
797 B
TypeScript

import type { LocalGitExecOptions } from './github-repository-identity'
export function githubApiRepositoryProbeCacheKey(
repoPath: string,
remoteName: string,
connectionId: string | null | undefined,
localGitOptions: LocalGitExecOptions,
requireVerifiedSshProbe: boolean
): string {
const runtimeKey = connectionId
? `ssh:${connectionId}`
: `local:${localGitOptions.wslDistro ?? 'host'}`
return `${runtimeKey}\0${repoPath}\0${remoteName}\0${requireVerifiedSshProbe ? 'verified' : 'tolerant'}`
}
export function resolveGitHubApiRepositoryProbe<T>(
value: T | undefined,
requireVerifiedSshProbe: boolean
): T | null {
if (value === undefined && requireVerifiedSshProbe) {
throw new Error('GitHub repository identity is unverifiable.')
}
return value ?? null
}