Repository navigation
Commit 487219f
fix(shared): normalize a bare Windows drive root the same as C:\ / C:/
`isRootPath` treated the drive separator as optional (`^[a-zA-Z]:[/\\]?$`), so a
bare `C:` was considered already-canonical and `trimTrailingPathSeparators`
returned it unchanged as `C:`, while `C:\` and `C:/` normalize to the drive
root. The canonical project-path-identity helpers
`normalizeProjectPathForComparison` / `normalizeProjectPathForDispatch` (used for
project matching and preference-key dedup across server, client-runtime, and web)
therefore treated `C:` and `C:\` as different locations, so a project rooted at a
bare drive silently failed identity/dedup checks against the same drive as `C:\`.
Require the separator (`^[a-zA-Z]:[/\\]$`). A bare `C:` now falls through to the
existing canonicalizer, which appends the separator, so `C:`, `C:\` and `C:/`
all normalize to the same drive root. Bare `C:` is also not the drive root in
Windows semantics (it means "current directory on C:"), so this is more correct.
Non-root paths and the `/` and `\` roots are unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>1 parent ac4780f commit 487219f
2 files changed
Lines changed: 17 additions & 1 deletion
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
34 | 46 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
0 commit comments