fast-import: do not call diff_delta() with empty buffer
We know diff_delta() returns NULL, saying "no good delta exists for it", when fed an empty data. Check the length of the data in the caller to avoid such a call. This incidentally reduces the number of attempted deltification we see in the final statistics. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mike Hommey committed
Jul 1, 2018 at 06:41 UTC
9d14ecf39dc70cd2d2cf639d873b8e2c7f039d11
1 file changed
+1
-1
fast-import.c
+1
-1
@@ -1076,7 +1076,7 @@ static int store_object(
1076
return 1;
1077
}
1078
1079
- if (last && last->data.buf && last->depth < max_depth
1079
+ if (last && last->data.len && last->data.buf && last->depth < max_depth
1080
&& dat->len > the_hash_algo->rawsz) {
1081
1082
delta_count_attempts_by_type[type]++;