git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fast-import: Don't count delta attempts against an empty buffer

From
Mike Hommey <mh@glandium.org>
Date
Jun 30, 2018, 21:41 UTC
Message-ID
<20180630214106.19848-1-mh@glandium.org>

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
Next: Junio C Hamano
Message 1 of 4 in “fast-import: Don't count delta attempts against an empty buffer”
  1. fast-import: Don't count delta attempts against an empty bufferMike Hommey, Jun 30, 2018
  2. Junio C HamanoJul 3, 2018
  3. Mike HommeyJul 3, 2018
  4. Junio C HamanoJul 6, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.