Linus Torvalds  committed 51d1e83

Do not try futile object pairs when repacking.

In the repacking window, if both objects we are looking at already came
from the same (old) pack-file, don't bother delta'ing them against each

That means that we'll still always check for better deltas for (and
against!) _unpacked_ objects, but assuming incremental repacks, you'll
avoid the delta creation 99% of the time.

Signed-off-by: Linus Torvalds <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 75dedd5

Comments (0)

Files changed (1)

File pack-objects.c

 		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.