Trap EOF during fetch connection initialization as "not found"
commitecdd7b599f3877775401bebde4c270f68433c595
authorShawn O. Pearce <spearce@spearce.org>
Mon, 5 May 2008 01:02:34 +0000 (4 21:02 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 11 May 2008 05:16:35 +0000 (11 01:16 -0400)
tree831f313d8d300cb9831fe027cf07ee62e2a751e5
parent22fff2b08931ce04e62ac36285ff75089e2c0647
Trap EOF during fetch connection initialization as "not found"

If a Git client asks a remote peer to run git-upload-pack on a
directory that is not a Git repository we get nothing at all in
return from the git-upload-pack side of the connection; instead
we get EOF while waiting for the length part of the first ref's
packet line.  This is not very user friendly, but is meant as a
way to prevent leaking information from the remote side to an
unfriendly client.

We detect this case and translate it to a TransportException,
using a slightly better error message for the end-user.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/transport/PackFetchConnection.java