author | Dmitry Potapov <dpotapov@gmail.com> | |
Mon, 10 May 2010 21:38:17 +0000 (01:38 +0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 May 2010 04:46:36 +0000 (21:46 -0700) | ||
commit | 08bda2085cc095863888bb4bb7a73960a9a379fd | |
tree | aa76877c238015bbd12b801064bd66ea5248b5fd | tree | snapshot |
parent | 3368edd4cda6306d524e10758e2c5a187dcd4ba6 | commit | diff |
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>
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 | diff | blob | history |