summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-01-12 23:33:39 -0800
committerJunio C Hamano <gitster@pobox.com>2012-01-12 23:33:39 -0800
commitc4a01a3cbbd8b642a3ffc6bc550b68ac63d500ed (patch)
tree29ba467aeb81889053419a311a88ac89915f7e7b /builtin/pack-objects.c
parent0e1cfc52de002e2d9b0e6562e8672fee3bf45a67 (diff)
parentab8a78084b7159d99dae2905e1a3ff04c1500a6d (diff)
downloadgit-c4a01a3cbbd8b642a3ffc6bc550b68ac63d500ed.tar.gz
Merge branch 'maint'
* maint: Update draft release notes to 1.7.8.4 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
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 96c1680976..0f2e7b8f5c 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1434,11 +1434,16 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
return -1;
/*
- * We do not bother to try a delta that we discarded
- * on an earlier try, but only when reusing delta data.
+ * We do not bother to try a delta that we discarded on an
+ * earlier try, but only when reusing delta data. Note that
+ * src_entry that is marked as the preferred_base should always
+ * be considered, as even if we produce a suboptimal delta against
+ * it, we will still save the transfer cost, as we already know
+ * the other side has it and we won't send src_entry at all.
*/
if (reuse_delta && trg_entry->in_pack &&
trg_entry->in_pack == src_entry->in_pack &&
+ !src_entry->preferred_base &&
trg_entry->in_pack_type != OBJ_REF_DELTA &&
trg_entry->in_pack_type != OBJ_OFS_DELTA)
return 0;