summaryrefslogtreecommitdiff
path: root/pack-objects.c
diff options
context:
space:
mode:
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pack-objects.c b/pack-objects.c
index bed2497..6e17676 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -988,6 +988,13 @@ 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.
+ */
+ if (trg_entry->in_pack && trg_entry->in_pack == src_entry->in_pack)
+ return 0;
+
+ /*
* If the current object is at pack edge, take the depth the
* objects that depend on the current object into account --
* otherwise they would become too deep.