fix(desktop): support spaced Windows Git paths in review - #67612
Merged
Conversation
simple-git's custom-binary validation rejects paths containing spaces, so the default Windows Git install (C:\Program Files\Git\cmd\git.exe) made every Review pane git call throw and the pane silently showed 'No diffs'. The binary is resolved inside the Electron main process from known install locations or PATH — never renderer/user input — so for spaced paths we opt into simple-git's supported unsafe.allowUnsafeCustomBinary escape hatch rather than falling back to PATH (often absent in GUI-launched apps). Simplified from PR #64713 by @unsupportedpastels; supersedes the 8.3 short-path approaches in #55337/#60156. Fixes #54888
Collaborator
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Desktop Review pane now works on Windows when Git lives at a path containing spaces (the default
C:\Program Files\Git\cmd\git.exe). simple-git's custom-binary validation rejects spaced paths, so every review IPC call threw and the pane silently showed "No diffs" (#54888).Minimal fix: in
gitFor()— the single simple-git constructor all desktop git ops use — when the internally resolved binary contains whitespace, opt into simple-git's supportedunsafe.allowUnsafeCustomBinaryescape hatch. The binary is resolved in the Electron main process from known install locations or PATH, never renderer/user input, so keeping the trusted absolute path beats falling back to PATH (often absent in GUI-launched apps; PATH lookup could also resolve a repo-localgit.exe).Simplified from #64713 by @unsupportedpastels (authorship preserved): drops the
cmd.exe8.3 short-path conversion layer — the escape hatch alone covers all volumes, including those with 8.3 names disabled. Supersedes #55337 / #60156.Changes
apps/desktop/electron/git-review-ops.ts:gitFor()setsunsafe.allowUnsafeCustomBinaryonly when the resolved binary contains whitespace;gitForexported for testsapps/desktop/electron/git-review-ops.test.ts: constructor accepts a spaced Windows path (all OS); livestatus()through the real spaced Git for Windows binary (win32-only, skips when absent)Validation
gitFor(cwd, 'C:\Program Files\Git\cmd\git.exe')GitPluginErrorgit-review-ops.test.ts)tsc -p tsconfig.electron.json --noEmitFixes #54888
Infographic