Avoid deadlock while fetching from local repository
We cannot send a packet line end command to git-upload-pack after we
have sent our want list and obtained a pack back from it. Once the
want list has ended git-upload-pack wants no further data sent to
it, and attempting to write more may cause us to deadlock as the
pipe won't accept the data.
Not sending the packet line end if we don't send a want list is a
(minor) protocol error. To avoid these protocol errors (which
may display on stderr from git-upload-pack) we still send the end
during close if we have not yet sent a want list.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>