Skip to content

Commit

Permalink
Do not try futile object pairs when repacking.
Browse files Browse the repository at this point in the history
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
other.

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 <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Jun 29, 2006
1 parent 75dedd5 commit 51d1e83
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,13 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
if (trg_entry->preferred_base)
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 --
Expand Down

0 comments on commit 51d1e83

Please sign in to comment.