mirror of
https://github.com/stablyai/orca.git
synced 2026-10-07 16:02:29 +00:00
* fix(git): reduce queries and preserve data across execution hosts * fix(ci): exercise pinned Git and serialize mobile dependency entrypoints * fix(relay): preserve fresh diff retries after hung shared reads * test(git): wait for fetch barrier before canceling preparation * fix(i18n): describe index-preserving discard in every locale * fix(git): retain clone diagnostics and allow WSL policy startup * test(git): refresh default-base and branch-safety fixtures
24 lines
624 B
TypeScript
24 lines
624 B
TypeScript
import { classifyGitCommand } from './git-command-classification'
|
|
|
|
export const GIT_READ_TIMEOUT_MS = 120_000
|
|
|
|
export class GitCommandTimeoutError extends Error {
|
|
readonly timeoutMs: number
|
|
|
|
constructor(timeoutMs: number) {
|
|
super('git timed out.')
|
|
this.name = 'GitCommandTimeoutError'
|
|
this.timeoutMs = timeoutMs
|
|
}
|
|
}
|
|
|
|
export function gitCommandTimeoutMs(
|
|
args: readonly string[],
|
|
explicitTimeoutMs: number | undefined,
|
|
defaultReadTimeoutMs = GIT_READ_TIMEOUT_MS
|
|
): number | undefined {
|
|
return (
|
|
explicitTimeoutMs ?? (classifyGitCommand(args) === 'read' ? defaultReadTimeoutMs : undefined)
|
|
)
|
|
}
|