path: root/pack-objects.c
diff options
authorJunio C Hamano <>2006-04-21 06:36:22 (GMT)
committerJunio C Hamano <>2006-04-21 06:36:22 (GMT)
commitf527cb8c38964a90b1b13485f2ad46b72960d387 (patch)
tree2fadb4a9a01d0014945e95b031d761142c092f48 /pack-objects.c
parent6a74642c500118164ec331da93ef29b1163301bc (diff)
pack-objects: do not stop at object that is "too small"
Because we sort the delta window by name-hash and then size, hitting an object that is too small to consider as a delta base for the current object does not mean we do not have better candidate in the window beyond it. Noticed by Shawn Pearce, analyzed by Nico, Linus and me. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pack-objects.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/pack-objects.c b/pack-objects.c
index 09f4f2c..f7d6217 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -1052,7 +1052,7 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
if (cur_entry->delta)
max_size = cur_entry->delta_size-1;
if (sizediff >= max_size)
- return -1;
+ return 0;
delta_buf = diff_delta(old->data, oldsize,
cur->data, size, &delta_size, max_size);
if (!delta_buf)