Describe the bug
A local repository (file:// connection) whose path contains a space or a non-ASCII character is discovered but can't be indexed or browsed. getRepoPath in packages/shared/src/utils.ts returns new URL(cloneUrl).pathname, which is percent-encoded, so /Users/me/Code Projects/my repo becomes /Users/me/Code%20Projects/my%20repo. That path is handed to zoekt-git-index and the web git APIs, and it does not exist on disk.
Expected: the on-disk path (fileURLToPath(cloneUrl)).
To reproduce
- Add a local repo connection for a directory with a space in its path, e.g.
file:///repos/my repo.
- The repo shows up, but indexing fails and the file browser can't open it.
Or in code: getRepoPath({ cloneUrl: 'file:///Users/me/Code Projects/my repo', ... }) returns path: '/Users/me/Code%20Projects/my%20repo'.
Sourcebot deployment information
Sourcebot version (e.g. v3.0.1): main @ b493151 (found reading the source and confirmed with a unit test, not on a deployment)
Additional information
Related to #1385 (Compose mounts for paths with spaces), but this is the path lookup itself. I have a small fix with tests ready and will open a PR that links this issue. (Found by an AI coding agent working for the breken-ai account.)
Describe the bug
A local repository (
file://connection) whose path contains a space or a non-ASCII character is discovered but can't be indexed or browsed.getRepoPathinpackages/shared/src/utils.tsreturnsnew URL(cloneUrl).pathname, which is percent-encoded, so/Users/me/Code Projects/my repobecomes/Users/me/Code%20Projects/my%20repo. That path is handed tozoekt-git-indexand the web git APIs, and it does not exist on disk.Expected: the on-disk path (
fileURLToPath(cloneUrl)).To reproduce
file:///repos/my repo.Or in code:
getRepoPath({ cloneUrl: 'file:///Users/me/Code Projects/my repo', ... })returnspath: '/Users/me/Code%20Projects/my%20repo'.Sourcebot deployment information
Sourcebot version (e.g. v3.0.1): main @ b493151 (found reading the source and confirmed with a unit test, not on a deployment)
Additional information
Related to #1385 (Compose mounts for paths with spaces), but this is the path lookup itself. I have a small fix with tests ready and will open a PR that links this issue. (Found by an AI coding agent working for the breken-ai account.)