[PR #607] fix: use to_git_bash_path() for all agents on Windows (fixes #606) #603

Closed
opened 2026-03-02 04:14:05 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/git-ai-project/git-ai/pull/607

State: closed
Merged: No


fix: use to_git_bash_path() for all agents on Windows (fixes #606)

Summary

PR #603 fixed Claude Code's hook commands to use git bash style paths (/c/Users/...) instead of Windows-native paths (C:\Users\...), but the same bug existed in all other agents. This PR applies to_git_bash_path() to the remaining 6 agents:

  • cursor.rsparams.binary_path.display()to_git_bash_path()
  • codex.rsbinary_path.display().to_string()to_git_bash_path()
  • github_copilot.rsparams.binary_path.display()to_git_bash_path() (in both check_hooks and install_hooks)
  • gemini.rsparams.binary_path.display()to_git_bash_path()
  • droid.rsparams.binary_path.to_string_lossy().to_string()to_git_bash_path()
  • opencode.rsbinary_path.display().to_string()to_git_bash_path() (before the backslash-escape step)

Each agent also gets 3 regression tests: Windows path conversion, Unix path preservation, and \\?\ extended prefix handling.

Review & Testing Checklist for Human

  • Verify on actual Windows + Fork: These changes were unit-tested with synthetic Windows paths on Linux. The real fix should be verified by running git-ai install on Windows with Fork and confirming each agent's hook config contains /c/... style paths rather than C:\....
  • github_copilot.rs check_hooks path comparison: This PR also changes the path format used in check_hooks for comparing existing hooks. Existing Windows installations will see hooks as "not up to date" and get re-installed on next run. Confirm this upgrade-path behavior is acceptable.
  • opencode.rs residual backslash escape: After to_git_bash_path(), the .replace('\\', "\\\\") is retained as a safety net. Since to_git_bash_path converts all backslashes to forward slashes on Windows paths, this replace is effectively a no-op. Confirm this is fine vs. removing it.

Notes


Open with Devin
**Original Pull Request:** https://github.com/git-ai-project/git-ai/pull/607 **State:** closed **Merged:** No --- # fix: use to_git_bash_path() for all agents on Windows (fixes #606) ## Summary PR #603 fixed Claude Code's hook commands to use git bash style paths (`/c/Users/...`) instead of Windows-native paths (`C:\Users\...`), but the same bug existed in all other agents. This PR applies `to_git_bash_path()` to the remaining 6 agents: - **cursor.rs** — `params.binary_path.display()` → `to_git_bash_path()` - **codex.rs** — `binary_path.display().to_string()` → `to_git_bash_path()` - **github_copilot.rs** — `params.binary_path.display()` → `to_git_bash_path()` (in both `check_hooks` and `install_hooks`) - **gemini.rs** — `params.binary_path.display()` → `to_git_bash_path()` - **droid.rs** — `params.binary_path.to_string_lossy().to_string()` → `to_git_bash_path()` - **opencode.rs** — `binary_path.display().to_string()` → `to_git_bash_path()` (before the backslash-escape step) Each agent also gets 3 regression tests: Windows path conversion, Unix path preservation, and `\\?\` extended prefix handling. ## Review & Testing Checklist for Human - [ ] **Verify on actual Windows + Fork**: These changes were unit-tested with synthetic Windows paths on Linux. The real fix should be verified by running `git-ai install` on Windows with Fork and confirming each agent's hook config contains `/c/...` style paths rather than `C:\...`. - [ ] **github_copilot.rs `check_hooks` path comparison**: This PR also changes the path format used in `check_hooks` for comparing existing hooks. Existing Windows installations will see hooks as "not up to date" and get re-installed on next run. Confirm this upgrade-path behavior is acceptable. - [ ] **opencode.rs residual backslash escape**: After `to_git_bash_path()`, the `.replace('\\', "\\\\")` is retained as a safety net. Since `to_git_bash_path` converts all backslashes to forward slashes on Windows paths, this replace is effectively a no-op. Confirm this is fine vs. removing it. ### Notes - Requested by: @svarlamov - Link to Devin run: https://app.devin.ai/sessions/a71373aedf6740cc882328f2244f6b28 - All 1137 existing tests pass - Follows the same pattern as the Claude Code fix in PR #603 <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/git-ai-project/git-ai/pull/607" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
kerem closed this issue 2026-03-02 04:14:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#603
No description provided.