Skip to content

Commit 5a6a939

Browse files
committed
Merge branch 'maint-1.7.7' into maint
* maint-1.7.7: Update draft release notes to 1.7.7.6 Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
2 parents 113e828 + 8f83acf commit 5a6a939

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-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.

Documentation/RelNotes/1.7.7.6.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ Fixes since v1.7.7.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
@@ -1456,11 +1456,16 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
14561456
return -1;
14571457

14581458
/*
1459-
* We do not bother to try a delta that we discarded
1460-
* on an earlier try, but only when reusing delta data.
1459+
* We do not bother to try a delta that we discarded on an
1460+
* earlier try, but only when reusing delta data. Note that
1461+
* src_entry that is marked as the preferred_base should always
1462+
* be considered, as even if we produce a suboptimal delta against
1463+
* it, we will still save the transfer cost, as we already know
1464+
* the other side has it and we won't send src_entry at all.
14611465
*/
14621466
if (reuse_delta && trg_entry->in_pack &&
14631467
trg_entry->in_pack == src_entry->in_pack &&
1468+
!src_entry->preferred_base &&
14641469
trg_entry->in_pack_type != OBJ_REF_DELTA &&
14651470
trg_entry->in_pack_type != OBJ_OFS_DELTA)
14661471
return 0;

0 commit comments

Comments
 (0)