Skip to content

Added failing test for relative remote URLs (#648) #649

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
wants to merge 1 commit into from

Conversation

Yogu
Copy link
Contributor

@Yogu Yogu commented Mar 10, 2014

git.git supports relative URLs in remote configurations and resolves them relative to the working directory. libgit2 currently fails with "Unsupported URL protocol".

git.git supports relative URLs in remote configurations and resolves them relative to the working directory. libgit2 currently fails with "Unsupported URL protocol".
@Yogu
Copy link
Contributor Author

Yogu commented Mar 10, 2014

I think the problem is transport_find_fn which normally chooses the file protocol if the file pointed to by the url exists, but it does not correctly handle relative paths. It passes the relative path directly to access, which will use the current working directory instead of the repository's working directory as a reference.

I'm not sure if this can be fixed without passing the repository's workdir to transport_find_fn.

@nulltoken
Copy link
Member

/cc @carlosmn

@carlosmn
Copy link
Member

It expects paths to be absolute, and I think we should keep it that way. It should be enough to detect a relative path in the remote and make give the absolute path to the transport finding function. Especially since the user can override it, so we should be making the input more predictable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants