Community
Participate
Working Groups
When I try to open transport for non-existing git repository using file protocol I get misleading error message: org.eclipse.jgit.errors.NotSupportedException: URI not supported: /path/to/non-existing/repository.git at org.eclipse.jgit.transport.Transport.open(Transport.java:354) at org.eclipse.jgit.transport.Transport.open(Transport.java:137) at org.eclipse.jgit.transport.Transport.open(Transport.java:110) Perhaps repository resolution should not be done in canHandle() method of org.eclipse.jgit.transport.TransportLocal and org.eclipse.jgit.transport.TransportBundleFile (patch for TransportLocal is attached). In this case we will get more meaningfull error message: org.eclipse.jgit.errors.TransportException: Remote does not have refs/heads/master available for fetch. at org.eclipse.jgit.transport.FetchProcess.expandSingle(FetchProcess.java:320) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:131) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:109) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:814)
Created attachment 170940 [details] possible fix
With this solution I get a strange error message for push: "file:///C:/path/to/non-existing/repository.git: Pipe closed." if there is no repository for this path. Maybe we could throw in this case already a NotSupportedException in TransportLocal.canHandle with a more meaningful error message like "file:///C:/path/to/non-existing/repository.git does not exist"?
Sounds good for me
Stefan, what do you think about this patch: http://egit.eclipse.org/r/2606 ?
Fixed by commit 305a8ac45f350580957743b3b3aa4c4eca0a6396