mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
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>
This commit is contained in:
parent
6a74642c50
commit
f527cb8c38
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue