Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315564

Summary: Confusing error message for file:// protocol
Product: [Technology] JGit Reporter: Dmitry Neverov <dmitry.neverov>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn, sop, stefan.lay
Version: unspecified   
Target Milestone: 0.12   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
possible fix none

Description Dmitry Neverov CLA 2010-06-03 08:05:01 EDT
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)
Comment 1 Dmitry Neverov CLA 2010-06-03 08:07:09 EDT
Created attachment 170940 [details]
possible fix
Comment 2 Stefan Lay CLA 2010-09-28 10:34:32 EDT
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"?
Comment 3 Dmitry Neverov CLA 2010-09-28 11:14:42 EDT
Sounds good for me
Comment 4 Dmitry Neverov CLA 2011-02-26 13:04:03 EST
Stefan, what do you think about this patch: http://egit.eclipse.org/r/2606 ?
Comment 5 Shawn Pearce CLA 2011-03-14 11:42:38 EDT
Fixed by commit 305a8ac45f350580957743b3b3aa4c4eca0a6396