From: Mike Hommey <mh@glandium.org>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] fast-import: Don't count delta attempts against an empty buffer
Date: Sun, 1 Jul 2018 06:41:06 +0900 [thread overview]
Message-ID: <20180630214106.19848-1-mh@glandium.org> (raw)
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 reply other threads:[~2018-06-30 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-30 21:41 Mike Hommey [this message]
2018-07-03 18:41 ` [PATCH] fast-import: Don't count delta attempts against an empty buffer Junio C Hamano
2018-07-03 21:59 ` Mike Hommey
2018-07-06 16:45 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180630214106.19848-1-mh@glandium.org \
--to=mh@glandium.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).