fix(git): keep the agent-terminal credential guard scalar-only so env scrubs can't break git (#38716)

* fix(git): keep the agent-terminal credential guard scalar-only so env scrubs can't break git

Agents that scrub env names matching KEY/TOKEN/... (DeepSeek Harness) dropped
GIT_CONFIG_KEY_n but kept GIT_CONFIG_COUNT, so every git command in those
terminals failed with "missing config key GIT_CONFIG_KEY_0". GCM_INTERACTIVE
already carries credential.interactive and suppresses GCM's GUI, so the guard
now emits only scalar variables. Tracked in #26594.

Co-authored-by: yu.xia <yuxianice@163.com>

* chore(git): drop stale indexed-config comments and a dead WSL forward branch

---------

Co-authored-by: yu.xia <yuxianice@163.com>
This commit is contained in:
Brennan Benson
2026-11-05 16:04:25 -08:00
committed by GitHub
co-authored by yu.xia
parent 27b1ed858c
commit 369e23b084
11 changed files with 51 additions and 143 deletions
@@ -11,8 +11,6 @@ export function gitOptionalLocksDisabledEnv(
}
}
/** Append Git >= 2.31 config-env entries without overwriting the caller's existing entries. */
/** Pin Git diagnostics to English so parsers work under any user locale. */
export function untranslatedGitOutputEnv(env: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
return { ...env, ...UNTRANSLATED_GIT_OUTPUT_ENV }