Files
orca/src/shared/git-command-timeout.ts
T
Neil 328caa2160 fix(git): reduce queries and preserve data across execution hosts (#24602)
* 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
2026-10-02 18:05:37 -07:00

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)
)
}