Skip to content

Commit e9195b5

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin-pack-objects.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,9 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
11761176
* on an earlier try, but only when reusing delta data.
11771177
*/
11781178
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)
11801182
return 0;
11811183

11821184
/*

0 commit comments

Comments
 (0)