hash_object: correction for zero length file
commit08bda2085cc095863888bb4bb7a73960a9a379fd
authorDmitry Potapov <dpotapov@gmail.com>
Mon, 10 May 2010 21:38:17 +0000 (11 01:38 +0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 May 2010 04:46:36 +0000 (18 21:46 -0700)
treeaa76877c238015bbd12b801064bd66ea5248b5fd
parent3368edd4cda6306d524e10758e2c5a187dcd4ba6
hash_object: correction for zero length file

The check whether size is zero was done after if size <= SMALL_FILE_SIZE,
as result, zero size case was never triggered. Instead zero length file
was treated as any other small file. This did not caused any problem, but
if we have a special case for size equal to zero, it is better to make it
work and avoid redundant malloc().

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c