Skip to content

Commit f527cb8

Browse files
author
Junio C Hamano
committed
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>
1 parent 6a74642 commit f527cb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
10521052
if (cur_entry->delta)
10531053
max_size = cur_entry->delta_size-1;
10541054
if (sizediff >= max_size)
1055-
return -1;
1055+
return 0;
10561056
delta_buf = diff_delta(old->data, oldsize,
10571057
cur->data, size, &delta_size, max_size);
10581058
if (!delta_buf)

0 commit comments

Comments
 (0)