Files
l0ng-ai 573064064e fix(git): ask a path's own host how it is spelled
This branch settles a repository's key on one spelling, but it settles it
with *this* machine's rules everywhere: `local_spelling` folds `/` to `\`
and strips `\\?\` on any Windows build, whatever machine the path is on.
Every boundary it was applied at also serves a remote workspace.

- `core::git::git_path` parses `rev-parse` output client-side, for
  `probe`, `probe_status`, `probe_diff` and `worktree`, whichever host ran
  the command;
- `GitStatusCache::key` is `ByHost`, and `refresh_git_status` probes a
  remote pane's cwd under that pane's `HostId`;
- `scm_repo_root` resolves the root every SCM write then runs `git` from.

So on a Windows client with an SSH or WSL workspace `/home/u/src` became
`\home\u\src`, and that string is what goes back over the wire verbatim —
`RemoteHost`'s `wire_path` is `to_string_lossy` — as the cwd of the next
`git`, as the `ScmData` key and as the `.git` watch path. It names nothing
on the far side, and it is what the sidebar draws.

`path_spelling::spelling_on` puts the question where #795 puts it: path
syntax is a property of the machine the path is *on*, not of the one
asking. A local host still gets the whole rule, so the `\\?\` fix and the
editor-watch fix are untouched; a remote host is handed back exactly what
it said, which is what this tree did before the rule existed.

Two regression tests, both ungated because Windows is the only client they
can fail on. `git_status::a_repository_on_another_machine_keeps_that_
machines_spelling` fails without this change with
`left: Some("\\home\\u\\src")  right: Some("/home/u/src")`.
2026-09-07 22:23:45 +08:00
..