Skip to content

Commit 901c907

Browse files
committed
Merge branch 'maint-1.7.6' into maint-1.7.7
* maint-1.7.6: Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
2 parents afb6b56 + 04f6785 commit 901c907

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Documentation/RelNotes/1.7.6.6.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ Fixes since v1.7.6.5
88
directory when two paths in question are in adjacent directories and
99
the name of the one directory is a prefix of the other.
1010

11+
* When producing a "thin pack" (primarily used in bundles and smart
12+
HTTP transfers) out of a fully packed repository, we unnecessarily
13+
avoided sending recent objects as a delta against objects we know
14+
the other side has.
15+
1116
Also contains minor fixes and documentation updates.

builtin/pack-objects.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,11 +1421,16 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
14211421
return -1;
14221422

14231423
/*
1424-
* We do not bother to try a delta that we discarded
1425-
* on an earlier try, but only when reusing delta data.
1424+
* We do not bother to try a delta that we discarded on an
1425+
* earlier try, but only when reusing delta data. Note that
1426+
* src_entry that is marked as the preferred_base should always
1427+
* be considered, as even if we produce a suboptimal delta against
1428+
* it, we will still save the transfer cost, as we already know
1429+
* the other side has it and we won't send src_entry at all.
14261430
*/
14271431
if (reuse_delta && trg_entry->in_pack &&
14281432
trg_entry->in_pack == src_entry->in_pack &&
1433+
!src_entry->preferred_base &&
14291434
trg_entry->in_pack_type != OBJ_REF_DELTA &&
14301435
trg_entry->in_pack_type != OBJ_OFS_DELTA)
14311436
return 0;

0 commit comments

Comments
 (0)