Skip to content

file: protocol support on Windows doesn't appear to work #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomqwpl opened this issue Nov 25, 2021 · 2 comments · Fixed by #416
Closed

file: protocol support on Windows doesn't appear to work #415

tomqwpl opened this issue Nov 25, 2021 · 2 comments · Fixed by #416
Labels
bug Something isn't working help wanted Extra attention is needed stale Issues/PRs that are marked for closure due to inactivity windows

Comments

@tomqwpl
Copy link
Contributor

tomqwpl commented Nov 25, 2021

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.

tomqwpl added a commit to WorldProgrammingLtd/go-git that referenced this issue Nov 26, 2021
hairyhenderson pushed a commit to hairyhenderson/go-git that referenced this issue Nov 20, 2023
hairyhenderson pushed a commit to hairyhenderson/go-git that referenced this issue Nov 20, 2023
@pjbgf pjbgf added the bug Something isn't working label Nov 20, 2023
hairyhenderson pushed a commit to hairyhenderson/go-git that referenced this issue Dec 22, 2023
hairyhenderson pushed a commit to hairyhenderson/go-git that referenced this issue Jan 12, 2024
Copy link

To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.

This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.

We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.

Thanks for your understanding and cooperation!

@github-actions github-actions bot added the stale Issues/PRs that are marked for closure due to inactivity label Apr 16, 2024
@pjbgf pjbgf added help wanted Extra attention is needed windows labels Apr 16, 2024
@github-actions github-actions bot removed the stale Issues/PRs that are marked for closure due to inactivity label Apr 17, 2024
hairyhenderson pushed a commit to hairyhenderson/go-git that referenced this issue May 30, 2024
Copy link

github-actions bot commented Aug 9, 2024

To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.

This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.

We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.

Thanks for your understanding and cooperation!

@github-actions github-actions bot added the stale Issues/PRs that are marked for closure due to inactivity label Aug 9, 2024
pjbgf pushed a commit to pjbgf/go-git that referenced this issue Aug 9, 2024
@pjbgf pjbgf closed this as completed in #416 Aug 9, 2024
pjbgf pushed a commit that referenced this issue Aug 9, 2024
* adjust path extracted from file: url on Windows

Fixes #415
traidare pushed a commit to traidare/go-git that referenced this issue Oct 26, 2024
* adjust path extracted from file: url on Windows

Fixes go-git#415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed stale Issues/PRs that are marked for closure due to inactivity windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants