fix(git): preserve SSH review context and worktree ownership (#24945)

* fix(git): preserve SSH arguments and guard background writes

* test(terminal): settle fish fixture startup readiness

* fix(git): preserve bare UNC SSH paths

* fix(git): unescape shell operators in Windows SSH paths

* test(runtime): settle removal writes before fixture cleanup

* test(git): skip optional OpenSSH probe when unavailable

* perf(git): skip equal-tip reads and bound relay discovery

* test(processes): ratchet the removed relay Git spawn

* test(shells): wait for initial zsh output before sending input

* Fix SSH review context and recover Git maintenance cleanup safely

* Keep relay Git compatibility fixtures outside shared client projects

* Fence superseded maintenance and preserve mixed-version session search

* test: model Git child termination and search catalogs

* test: retain catalog authority over history flags
This commit is contained in:
Neil
2026-10-03 05:24:35 -07:00
committed by GitHub
parent aca2d51e0e
commit 62451920ed
78 changed files with 3841 additions and 513 deletions
+6 -1
View File
@@ -27,6 +27,7 @@ import { nonInteractiveGitEnv, untranslatedGitOutputEnv } from './git-process-en
import { acquireGitAdmission } from './git-subprocess-admission'
import { GitCommandTimeoutError, gitCommandTimeoutMs } from './git-command-timeout'
import { classifyGitCommand } from '../../../shared/git-command-classification'
import { createAbortError } from './abort-error'
/**
* Async git command execution. Drop-in replacement for
@@ -74,7 +75,7 @@ async function gitExecFileAsyncUnlocked(
cwd: options.cwd,
wslDistro: options.wslDistro,
tier: options.admissionTier,
signal: options.signal
signal: options.admissionSignal ?? options.signal
})
span?.setAttribute('git.queue_wait_ms', grant.queueWaitMs)
const timeoutMs = gitCommandTimeoutMs(args, options.timeout, options.timeoutMsForTest)
@@ -153,6 +154,10 @@ async function gitExecFileAsyncUnlocked(
}
}
try {
options.admissionSignal?.throwIfAborted()
if (options.canStart?.() === false) {
throw createAbortError()
}
return await runCapturedCommand()
} finally {
const termination = terminationState.current
@@ -16,6 +16,10 @@ export type GitExecOptions = {
stdin?: string
env?: NodeJS.ProcessEnv
signal?: AbortSignal
/** Cancels admission only; a running child still finishes. */
admissionSignal?: AbortSignal
/** Rechecks owner eligibility after admission, before starting the child. */
canStart?: () => boolean
wslDistro?: string
preferWslDirectGit?: boolean
useConfiguredSshCommandForNetwork?: boolean