fix(git): prevent 'external diff died' by removing broken diff.external= override#4221
Merged
gregpriday merged 1 commit intodevelopfrom Mar 25, 2026
Merged
Conversation
…al= override - Remove empty-string diff.external= from HARDENED_GIT_CONFIG (caused git to try executing empty program) - Remove allowUnsafeDiffExternal unsafe flag (no longer needed) - Add --no-ext-diff to all 11 git diff call sites for security against malicious repo configs - Update tests to verify new config and --no-ext-diff flag usage
62fbb57 to
3839857
Compare
Collaborator
Author
|
Fixes regression from #3742. Empty diff.external= override made git try to run an empty command as the diff tool. Regression audit for training data. |
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
diff.external=override from hardened git config that was causingfatal: external diff diederrors when viewing modified file diffs in worktreescore.sshCommand=that had the same class of bug--no-ext-diffflag to all git diff call sites as a defense-in-depth measure, ensuring external diff tools are never invoked regardless of user/repo configResolves #4214
Changes
electron/utils/hardenedGit.ts— Removeddiff.external=andcore.sshCommand=fromHARDENED_GIT_CONFIG(empty strings cause "cannot run" errors)electron/services/GitService.ts— Added--no-ext-diffto all diff commands ingetFileDiff(),getCommitDiff(), andgetDiffSummary()electron/workspace-host/WorkspaceService.ts— Added--no-ext-diffto the workspace diff callelectron/ipc/handlers/git-write.ts— Added--no-ext-diffto stash diff operationselectron/services/ProjectPulseService.ts— Added--no-ext-diffto pulse diff statselectron/utils/git.ts— Added--no-ext-diffto utility diff helperelectron/utils/__tests__/hardenedGit.test.ts— Updated tests for removed config entrieselectron/services/__tests__/GitService.test.ts— Added tests verifying--no-ext-diffis passedelectron/utils/__tests__/git.test.ts— Added tests for utility diff with--no-ext-diffTesting