Repository navigation
fix(install): keep file:// URLs slash-form on Windows - #346
Merged
Merged
Conversation
parseFileURL cleaned the path with filepath.Clean before prefixing it with `file://`, and on Windows Clean rewrites the separators, so `ss install file:///C:/repos/skills` handed git `file://\C:\repos\skills` and the clone failed. The URL form is slash-based on every platform; only the local-path branches need OS separators. Convert back with filepath.ToSlash and pin the shape with a drive-letter case in the existing table, which fails on Windows without the change and is inert on Unix.
Owner
|
@codex review |
Owner
runkids
approved these changes
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
parseFileURLcleaned the path and then prefixed it withfile://:filepath.Cleanrewrites separators for the local OS, so on Windows afile://URL is turnedinside out — a URL is slash-form on every platform, but the code emits the OS-native form:
CloneURLCloneURL(before)file:///path/to/repofile:///path/to/repofile://\path\to\repofile:///C:/repos/skillsfile://\C:\repos\skillsgit does not accept either Windows form as a local repository, so
install/addfrom a localpath — the workflow #269 and #264 reported — fails on the platform that ships binaries.
Part of #344.
Fix
filepath.ToSlashon the cleaned path. The cleaned value is still used for everything local,only the URL rendering changes, so Unix output is byte-identical.
Tests
New table case
file url with a drive path keeps URL separatorspins the URL form. On awindows/amd64build of./internal/install:7043ca3a:--- FAIL: TestParseSource_FileURL(CloneURL = file://\path\to\repo)The package still has Windows-specific failures this commit does not touch (e.g.
TestCopyDir_PreservesPermissions, which asserts POSIX mode bits), so it is not claimed green.