Code

Fix zero-object version-2 packs
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jun 2007 21:34:02 +0000 (14:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jun 2007 01:02:15 +0000 (18:02 -0700)
commit1164f1e48d7c8ed613e8a371ecfce27220606e09
tree62c634bcc0572fdff04f5015d26deca21aa6dd56
parent582c7393a47894ea299a82c2ae91fec3101e7559
Fix zero-object version-2 packs

A pack-file can get created without any objects in it (to transfer "no
data" - which can happen if you use a reference git repo, for example,
or just otherwise just end up transferring only branch head information
and already have all the objects themselves).

And while we probably should never create an index for such a pack, if we
do (and we do), the index file size sanity checking was incorrect.

This fixes it.

Reported-and-tested-by: Jocke Tjernlund <tjernlund@tjernlund.se>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c