Commit 08bda20
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>1 parent 3368edd commit 08bda20
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2448 | 2448 | | |
2449 | 2449 | | |
2450 | 2450 | | |
| 2451 | + | |
| 2452 | + | |
2451 | 2453 | | |
2452 | 2454 | | |
2453 | 2455 | | |
| |||
2456 | 2458 | | |
2457 | 2459 | | |
2458 | 2460 | | |
2459 | | - | |
| 2461 | + | |
2460 | 2462 | | |
2461 | 2463 | | |
2462 | 2464 | | |
2463 | | - | |
2464 | | - | |
| 2465 | + | |
2465 | 2466 | | |
2466 | 2467 | | |
2467 | 2468 | | |
| |||
0 commit comments