fix: Add dynamic Git detection; fix Windows 'command not found' and e…#749
Open
felix307253927 wants to merge 3 commits intoRightNow-AI:mainfrom
Open
fix: Add dynamic Git detection; fix Windows 'command not found' and e…#749felix307253927 wants to merge 3 commits intoRightNow-AI:mainfrom
felix307253927 wants to merge 3 commits intoRightNow-AI:mainfrom
Conversation
jaberjaber23
requested changes
Mar 19, 2026
Member
jaberjaber23
left a comment
There was a problem hiding this comment.
Security regression in the safe path. The original code intentionally runs commands without shell interpretation (direct argv). This PR wraps ALL safe-path commands in cmd /C on Windows, which reintroduces shell interpretation (pipes, redirects, & all become live). This defeats the entire purpose of the safe path.
Other issues:
Box::leakinget_git_sh_path()permanently leaks memory on every call. UseOnceLockortokio::sync::OnceCellto compute and cache once.- Missing
std::os::windows::process::CommandExtimport forcreation_flags(CREATE_NO_WINDOW)— won't compile on Windows. - PATH uses Unix colon separators but falls back to cmd.exe in some cases where semicolons are needed.
The cmd /C wrapping must be reverted from the safe path. The memory leak must be fixed. The missing import must be added.
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.
…ncoding issues.
Summary
Changes
feat: add dynamic Git Bash path detection
fix: resolve Windows encoding/garbled text issues
fix: handle "command not found" errors on Windows
fix: ensure Git built-in commands are found when using Git Bash on Windows
Testing
cargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepassesSecurity