When the reference buffer is empty, diff_delta returns NULL without
really attempting anything, yet fast-import counts that as a delta
attempt.

Signed-off-by: Mike Hommey <m...@glandium.org>
---
 fast-import.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fast-import.c b/fast-import.c
index 4d55910ab9..12195d54d7 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1076,7 +1076,7 @@ static int store_object(
                return 1;
        }
 
-       if (last && last->data.buf && last->depth < max_depth
+       if (last && last->data.len && last->data.buf && last->depth < max_depth
                && dat->len > the_hash_algo->rawsz) {
 
                delta_count_attempts_by_type[type]++;
-- 
2.18.0

Reply via email to