summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c2ca8d)
raw | patch | inline | side by side (parent: 8c2ca8d)
author | Nicolas Pitre <nico@fluxnic.net> | |
Wed, 17 Feb 2010 19:05:56 +0000 (14:05 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 17 Feb 2010 19:08:44 +0000 (11:08 -0800) |
This let diff_delta() abort early if it is going to bust the given
size limit. Also, only objects larger than 20 bytes are considered
as objects smaller than that are most certainly going to produce
larger deltas than the original object due to the additional headers.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
size limit. Also, only objects larger than 20 bytes are considered
as objects smaller than that are most certainly going to produce
larger deltas than the original object due to the additional headers.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 7fc98620b2f712c56b0a20a0b1508c4233f80801..74f08bd554ae4cab1dc9ee38272376e5cbec1200 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
return 1;
}
- if (last && last->data.buf && last->depth < max_depth) {
+ if (last && last->data.buf && last->depth < max_depth && dat->len > 20) {
delta = diff_delta(last->data.buf, last->data.len,
dat->buf, dat->len,
- &deltalen, 0);
- if (delta && deltalen >= dat->len) {
- free(delta);
- delta = NULL;
- }
+ &deltalen, dat->len - 20);
} else
delta = NULL;