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

pack-objects: tweak "do not even attempt delta" heuristics

The heuristics to give up deltification when both the source and the target are both in the same pack affects negatively when we are repacking the subset of objects in the existing pack. This caused any incremental updates to use suboptimal packs. Tweak the heuristics to avoid this problem. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 14, 2006 at 22:18 UTC e9195b584f6ad49b637b56be0705a7362a95d692
1 file changed +3 -1
builtin-pack-objects.c
+3 -1
@@ -1176,7 +1176,9 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
1176 * on an earlier try, but only when reusing delta data.
1177 */
1178 if (!no_reuse_delta && trg_entry->in_pack &&
1179 - trg_entry->in_pack == src_entry->in_pack)
1179 + trg_entry->in_pack == src_entry->in_pack &&
1180 + trg_entry->in_pack_type != OBJ_REF_DELTA &&
1181 + trg_entry->in_pack_type != OBJ_OFS_DELTA)
1182 return 0;
1183
1184 /*