Skip to content

The agent that grows with you

test(desktop): cover simple-git host tuple path

Fabio Motta6e78408e7092
diff --git a/apps/desktop/electron/git-review-ops.test.ts b/apps/desktop/electron/git-review-ops.test.ts
index 346543789c1..f4f765b73ff 100644
--- a/apps/desktop/electron/git-review-ops.test.ts
+++ b/apps/desktop/electron/git-review-ops.test.ts
@@ -16,6 +16,7 @@ import {
reviewList,
SIMPLE_GIT_UNSAFE_BINARY_WARN
} from './git-review-ops'
+import type * as NoConsoleGit from './no-console-git'
// `runGh` shells to the `gh` CLI via execFile. Mock it so reviewCreatePr's gh
// invocation is controllable (real `gh` may be absent or slow in CI) while the
@@ -71,6 +72,31 @@ test('gitFor accepts internally resolved git paths with restricted non-space cha
}
})
+test('gitFor accepts a Windows no-console host tuple with restricted characters', async () => {
+ vi.resetModules()
+ vi.doMock('./no-console-git', async importOriginal => {
+ const actual = await importOriginal<typeof NoConsoleGit>()
+
+ return {
+ ...actual,
+ windowsGitHost: () => ({
+ isWindows: true,
+ pythonBin: String.raw`C:\Tools\python-3.14+build\python.exe`,
+ scriptPath: String.raw`C:\Hermes\hermes-no-console-git.py`
+ })
+ }
+ })
+
+ try {
+ const { gitFor: gitForWithHostTuple } = await import('./git-review-ops')
+
+ assert.doesNotThrow(() => gitForWithHostTuple(process.cwd(), 'git'))
+ } finally {
+ vi.doUnmock('./no-console-git')
+ vi.resetModules()
+ }
+})
+
test('gitFor suppresses only the known custom-binary warning and restores console.warn', () => {
const spacedBin = String.raw`C:\Program Files\Git\cmd\git.exe`
// `windowsGitHost()` resolves nothing in this process (no configured roots, no