Files
orca/src/shared/git-ref-command-capabilities.ts
T
Neil 533992bdda fix(git): cache unsupported capabilities per host (#8109)
* fix(git): cache unsupported capabilities per host

Old Git worktree, ref-search, and merge-tree fallbacks retried unsupported flags on recurring operations, flooding subprocess traces. Centralize capability probing per native, WSL, and SSH execution host, coalesce concurrent probes, and retry periodically for in-place Git upgrades.

* fix(git): recognize real old-Git merge-tree rejection

* test(git): enforce real binary compatibility matrix

* fix(ci): preserve Git compatibility test ownership

* fix(git): retain supported capability state
2026-07-10 18:19:36 -07:00

15 lines
587 B
TypeScript

function getGitErrorText(error: unknown): string {
if (typeof error !== 'object' || error === null) {
return error instanceof Error ? error.message : String(error)
}
const values = ['message', 'stderr', 'stdout']
.map((key) => (error as Record<string, unknown>)[key])
.filter((value): value is string => typeof value === 'string')
return values.join('\n')
}
export function isForEachRefExcludeUnsupportedError(error: unknown): boolean {
const output = getGitErrorText(error).toLowerCase()
return output.includes('unknown option') && output.includes('exclude')
}