Commit f57bfab
committed
fix: Resolve Windows test failures - local path detection and Git path separators
This commit fixes two critical cross-platform issues causing test failures on Windows:
## Problem 1: Local Path Detection Fails on Windows
The preflight health check logic in split.rs and sync.rs only recognized Unix-style
paths (/, ./, ../), causing Windows paths like C:\Users\... to be incorrectly
identified as remote URLs. This triggered unnecessary SSH preflight checks that
failed in test environments.
### Solution:
- Added is_local_path() helper function that properly detects local paths on both
Unix and Windows
- Uses Path::is_absolute() which works cross-platform
- Handles Windows-specific cases: drive letters (C:\), UNC paths (\\server\share)
- Applied to both split.rs:114 and sync.rs:156
## Problem 2: Git Commands Receive Windows Backslashes
Git always expects forward slashes in path specifications (e.g., "HEAD:src/file.rs"),
even on Windows. However, Path::display() outputs backslashes on Windows, causing
git cat-file and git ls-tree commands to fail with "missing" file errors.
### Solution:
- Added path_to_git_format() helper in system_git_ops.rs that converts backslashes
to forward slashes on Windows
- Applied to all Git tree spec operations:
- read_files_bulk() at line 766 (bulk file reading)
- get_file_at_commit() at line 175 (single file reads)
- list_files_at_commit() at line 356 (tree listing)
## Impact:
- Fixes 16 failing integration tests on Windows (all test_split::*, test_sync::*,
test_workflow::* tests)
- Fixes 1 failing unit test (test_collect_tree_files_with_bulk)
- No behavior change on Unix/Linux/macOS
- Tests pass locally on macOS, should now pass on Windows CI runners
Closes the Windows test failure blocking issue.1 parent 98f7d3c commit f57bfab
3 files changed
+115
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
12 | 57 | | |
13 | 58 | | |
14 | 59 | | |
| |||
66 | 111 | | |
67 | 112 | | |
68 | 113 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 114 | + | |
72 | 115 | | |
73 | 116 | | |
74 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
12 | 57 | | |
13 | 58 | | |
14 | 59 | | |
| |||
108 | 153 | | |
109 | 154 | | |
110 | 155 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 156 | + | |
114 | 157 | | |
115 | 158 | | |
116 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
21 | 38 | | |
22 | 39 | | |
23 | 40 | | |
| |||
153 | 170 | | |
154 | 171 | | |
155 | 172 | | |
| 173 | + | |
156 | 174 | | |
157 | | - | |
| 175 | + | |
158 | 176 | | |
159 | 177 | | |
160 | 178 | | |
| |||
334 | 352 | | |
335 | 353 | | |
336 | 354 | | |
337 | | - | |
| 355 | + | |
| 356 | + | |
338 | 357 | | |
339 | 358 | | |
340 | 359 | | |
| |||
746 | 765 | | |
747 | 766 | | |
748 | 767 | | |
749 | | - | |
| 768 | + | |
| 769 | + | |
750 | 770 | | |
751 | 771 | | |
752 | 772 | | |
| |||
0 commit comments