@matheusbsbs / matheus-bagliano / commits / f527cb8c38
Fork 0

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 <junkio@cox.net>

Junio C Hamano committed Apr 20, 2006 at 23:36 UTC f527cb8c38964a90b1b13485f2ad46b72960d387
1 file changed +1 -1
pack-objects.c
+1 -1
@@ -1052,7 +1052,7 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
1052 if (cur_entry->delta)
1053 max_size = cur_entry->delta_size-1;
1054 if (sizediff >= max_size)
1055 - return -1;
1055 + return 0;
1056 delta_buf = diff_delta(old->data, oldsize,
1057 cur->data, size, &delta_size, max_size);
1058 if (!delta_buf)