fix: Fork on Windows store forward-slash path (fixes #606)#608
fix: Fork on Windows store forward-slash path (fixes #606)#608
Conversation
…#606) - Normalize git shim path to use forward slashes in Fork settings JSON on Windows (consistent with Sublime Merge and to_git_bash_path() from PR #603) - Add bash.exe shim creation in ensure_git_symlinks for Fork compatibility (Fork requires bash.exe next to the custom git instance) - Add regression tests for path normalization Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
|
No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits. |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
|
No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits. |
Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
| use serde_json::{Value, json}; | ||
|
|
||
| #[cfg(windows)] | ||
| fn fork_custom_git_instance_path(git_shim_path: &std::path::Path) -> String { |
There was a problem hiding this comment.
Good catch — Fork is a native Windows app, so CustomGitInstancePath should remain a valid Windows path (just with forward slashes). Updated fork_custom_git_instance_path to use clean_path(...).to_string_lossy().replace('\\', "/") and adjusted the Windows-only regression test accordingly.
…ime Merge Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
fix: Fork on Windows store forward-slash path (fixes #606)
Summary
Fixes #606 by updating the Fork Windows installer integration to store and compare a valid Windows path with forward slashes (e.g.
C:/Users/.../git.exe) forCustomGitInstancePath.Introduces a new shared
to_windows_git_bash_style_path()helper insrc/mdm/utils.rs— a companion to theto_git_bash_path()helper added in PR #603. Whileto_git_bash_pathproduces MSYS-style paths (/c/Users/...) for tools that run inside git bash (e.g. Claude Code hooks),to_windows_git_bash_style_pathproduces valid Windows paths with forward slashes (C:/Users/...) for native GUI apps that store paths in JSON settings files.Changes
src/mdm/utils.rs: Addedto_windows_git_bash_style_path(path) -> String— callsclean_path(strips\\?\prefix) then replaces backslashes with forward slashes. Added two regression tests.src/mdm/git_clients/fork_app.rs: Fork's Windowscheck_clientandinstall_prefsnow useto_windows_git_bash_style_path(via a thinfork_custom_git_instance_pathwrapper) instead of rawto_string_lossy(). Added a Windows-only regression test asserting the output isC:/...(not MSYS/c/...).src/mdm/git_clients/sublime_merge.rs: Refactored to use the same sharedto_windows_git_bash_style_pathhelper instead of inline.replace('\\', "/"), for consistency and to also gain theclean_pathprefix-stripping.Review & Testing Checklist for Human
git-ai install-hooksand confirm Fork accepts the configured custom git path and the setting persists after restarting Fork.%LOCALAPPDATA%\Fork\settings.jsonhasCustomGitInstancePathset to a validC:/.../git.exepath (not backslashes, not MSYS/c/...).git-ai install-hooksis a no-op (i.e.,check_clientcorrectly detects "up-to-date"). Note: if an existing installation previously stored a backslash path, the first run after this change will re-write it — this is expected.to_windows_git_bash_style_pathalso addsclean_pathprefix-stripping, which is a minor behavior change if paths ever had the\\?\extended prefix.Notes
#[cfg(all(test, windows))], so it only runs on Windows CI runners.