-
Notifications
You must be signed in to change notification settings - Fork 809
Description
I'm trying to use go-git with a file: protocol on Windows.
So my URL is something like "file:///c:/directory".
This parses correctly, host is "" (correctly), but the curiosity with windows file uRLs is that the path is then "/c:/directory".
This path is then passed to the git command line directly, and git then fails to clone.
It gives the appearance of working if you use a file url of "file://c:/directory", so only two slashes.
It only appears to work though, as the URL is parsed as "c" being the host, and "/directory" being the path. So it works as long as your current drive is "c:".
The logic for converting file: URLs into actual usable windows file paths has to be something like "if windows and path starts slash, letter, colon, slash, then remove the leading slash".
Note that you can't use windows file paths in go-git without using the URL form, as it interprets it as an scp like URL and not a file path.