| Summary: | URLish fails when passed file URI's | ||
|---|---|---|---|
| Product: | [Technology] JGit | Reporter: | Thomas Hallgren <thomas> |
| Component: | JGit | Assignee: | Christian Halstrick <christian.halstrick> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.sohn, robin.rosenberg, stefan.lay |
| Version: | 0.9.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I proposed a fix in http://egit.eclipse.org/r/#change,1690 . Let's see what the review brings. 2160c09dd4f678c5f2f8e730945be637210b39de fixes part of the problem Commit be2ddff6a72cff3d28b87d038a96194a6e2bd272 has fixed this problem A few remarks. There is a reason we call the class URIish, rather than URI and that is because Git's URI syntax is not that of URI's, just similar. Not supporting file:/path was a deliberate attempt at staying compatible with Git URI(ish) syntax. So a Git URI will consider the hostname to be 'file' when passed a 'file:/path'? (In reply to comment #5) > So a Git URI will consider the hostname to be 'file' when passed a > 'file:/path'? Yep... but I did not try to emulate that part of the ugliness. That's obviously a bug waiting to be fixed. Robin, are you sure about that? I can use file:/path without problems now with jgit. If I use jgit command line and do jgit clone file:/C:/git/egit/.git and it does what I expect. Anything I missed? (In reply to comment #7) > Robin, are you sure about that? I can use file:/path without problems now with > jgit. If I use jgit command line and do > > jgit clone file:/C:/git/egit/.git > > and it does what I expect. Anything I missed? Since the patch was merged (a while ago), I suppose it works, but it is a syntax that C Git does not understand. |
The class org.eclipse.jgit.transport.URlish is not capable of parsing a common file URL Example: File x = new File("/foo/bar"); String uriString = x.toURI().toURL().toString(); The resulting string is now: file:/foo/bar If I pass this to the URlish constructor I get an URlish with the host name 'file' which leads to an UnknownHostException later on.