Skip to content

fix: Fork on Windows store forward-slash path (fixes #606)#608

Merged
svarlamov merged 5 commits intomainfrom
devin/1772227689-fix-fork-windows-606
Feb 28, 2026
Merged

fix: Fork on Windows store forward-slash path (fixes #606)#608
svarlamov merged 5 commits intomainfrom
devin/1772227689-fix-fork-windows-606

Conversation

@svarlamov
Copy link
Member

@svarlamov svarlamov commented Feb 27, 2026

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) for CustomGitInstancePath.

Introduces a new shared to_windows_git_bash_style_path() helper in src/mdm/utils.rs — a companion to the to_git_bash_path() helper added in PR #603. While to_git_bash_path produces MSYS-style paths (/c/Users/...) for tools that run inside git bash (e.g. Claude Code hooks), to_windows_git_bash_style_path produces valid Windows paths with forward slashes (C:/Users/...) for native GUI apps that store paths in JSON settings files.

Changes

  • src/mdm/utils.rs: Added to_windows_git_bash_style_path(path) -> String — calls clean_path (strips \\?\ prefix) then replaces backslashes with forward slashes. Added two regression tests.
  • src/mdm/git_clients/fork_app.rs: Fork's Windows check_client and install_prefs now use to_windows_git_bash_style_path (via a thin fork_custom_git_instance_path wrapper) instead of raw to_string_lossy(). Added a Windows-only regression test asserting the output is C:/... (not MSYS /c/...).
  • src/mdm/git_clients/sublime_merge.rs: Refactored to use the same shared to_windows_git_bash_style_path helper instead of inline .replace('\\', "/"), for consistency and to also gain the clean_path prefix-stripping.

Review & Testing Checklist for Human

  • On a Windows machine with Fork installed, run git-ai install-hooks and confirm Fork accepts the configured custom git path and the setting persists after restarting Fork.
  • Verify %LOCALAPPDATA%\Fork\settings.json has CustomGitInstancePath set to a valid C:/.../git.exe path (not backslashes, not MSYS /c/...).
  • Verify that re-running git-ai install-hooks is a no-op (i.e., check_client correctly 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.
  • Verify Sublime Merge still works correctly on Windows — the refactor to use to_windows_git_bash_style_path also adds clean_path prefix-stripping, which is a minor behavior change if paths ever had the \\?\ extended prefix.

Notes

  • Requested by @svarlamov
  • Link to Devin run
  • This fix cannot be meaningfully end-to-end tested outside of a real Windows environment with Fork/Sublime Merge installed.
  • The Fork-specific regression test is gated behind #[cfg(all(test, windows))], so it only runs on Windows CI runners.

…#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>
@git-ai-cloud-dev
Copy link

No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits.

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@git-ai-cloud
Copy link

git-ai-cloud bot commented Feb 27, 2026

No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
@devin-ai-integration devin-ai-integration bot changed the title fix: Fork on Windows - normalize paths and ensure bash.exe shim (fixes #606) fix: Fork on Windows reuse to_git_bash_path helper (fixes #606) Feb 27, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@devin-ai-integration devin-ai-integration bot changed the title fix: Fork on Windows reuse to_git_bash_path helper (fixes #606) fix: Fork on Windows store forward-slash path (fixes #606) Feb 27, 2026
devin-ai-integration bot and others added 2 commits February 27, 2026 23:09
…ime Merge

Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
@svarlamov svarlamov merged commit 85cdfaa into main Feb 28, 2026
23 checks passed
@svarlamov svarlamov deleted the devin/1772227689-fix-fork-windows-606 branch February 28, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fork on Windows: install-hook not working

2 participants