Skip to content

Commit 9d14ecf

Browse files
glandiumgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e333175 commit 9d14ecf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fast-import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ static int store_object(
10761076
return 1;
10771077
}
10781078

1079-
if (last && last->data.buf && last->depth < max_depth
1079+
if (last && last->data.len && last->data.buf && last->depth < max_depth
10801080
&& dat->len > the_hash_algo->rawsz) {
10811081

10821082
delta_count_attempts_by_type[type]++;

0 commit comments

Comments
 (0)