git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fast-import: Don't count delta attempts against an empty buffer
@ 2018-06-30 21:41 Mike Hommey
  2018-07-03 18:41 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Hommey @ 2018-06-30 21:41 UTC (permalink / raw)
  To: git; +Cc: gitster

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 <mh@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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-06 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-30 21:41 [PATCH] fast-import: Don't count delta attempts against an empty buffer Mike Hommey
2018-07-03 18:41 ` Junio C Hamano
2018-07-03 21:59   ` Mike Hommey
2018-07-06 16:45     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).