mirror of
https://github.com/stablyai/orca.git
synced 2026-09-28 16:02:45 +00:00
* fix(github): fail closed when the SSH git provider is gone getCurrentHeadOid and probeTrackedUpstreamBranches only routed through the SSH provider when one was registered. With connectionId set but the provider unregistered (dropped connection, not yet reattached) they fell through to client-side git with cwd pointing at the remote repoPath — on a machine with a same-named local path that silently answers for the wrong repository. getCurrentHeadOid feeds shouldHideMergedImplicitPR, so a wrong OID changes which PR the UI attributes to a worktree. Both now take their existing unknown path (null / probeFailed) instead, matching repo-default-branch.ts. Local and WSL routing is unchanged. * fix(github): preserve PR state when SSH probes fail * fix(github): keep failed SSH discovery unverifiable * fix(github): propagate SSH identity failures * fix(github): scope verified SSH identity probes * test(github): preserve tolerant resolver calls * fix(github): preserve indeterminate auth discovery * fix(github): isolate SSH repository probe generations * test(github): expose SSH probe generation in mocks
21 lines
625 B
TypeScript
21 lines
625 B
TypeScript
import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types'
|
|
|
|
export type GitHubApiRepositoryResolution =
|
|
| GitHubOwnerRepo
|
|
| null
|
|
| undefined
|
|
| (() => Promise<GitHubOwnerRepo | null>)
|
|
|
|
// Why: renderer/RPC overrides reach authenticated REST paths.
|
|
const OWNER_SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9-]*$/
|
|
const REPOSITORY_SLUG_RE = /^[A-Za-z0-9._-]+$/
|
|
|
|
export function isValidGitHubApiRepository(repository: GitHubOwnerRepo): boolean {
|
|
return (
|
|
OWNER_SLUG_RE.test(repository.owner) &&
|
|
REPOSITORY_SLUG_RE.test(repository.repo) &&
|
|
repository.repo !== '.' &&
|
|
repository.repo !== '..'
|
|
)
|
|
}
|