diff options
author | Jeff King <peff@peff.net> | 2014-10-15 18:41:53 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-16 10:10:42 -0700 |
commit | d0d46abc167d18fdbdbf2ece8ca6df704517c62f (patch) | |
tree | 508d8fa8ab2a0adce9f6e0b4ae42306297721e77 /reachable.c | |
parent | d3038d22f91aad9620bd8e6fc43fc67c16219738 (diff) | |
download | git-d0d46abc167d18fdbdbf2ece8ca6df704517c62f.tar.gz |
pack-objects: refactor unpack-unreachable expiration check
When we are loosening unreachable packed objects, we do not
bother to process objects that would simply be pruned
immediately anyway. The "would be pruned" check is a simple
comparison, but is about to get more complicated. Let's pull
it out into a separate function.
Note that this is slightly less efficient than the original,
which avoided even opening old packs, since no object in
them could pass the current check, which cares only about
the pack mtime. But the new rules will depend on the exact
object, so we need to perform the check even for old packs.
Note also that we fix a minor buglet when the pack mtime is
exactly the same as the expiration time. The prune code
considers that worth pruning, whereas our check here
considered it worth keeping. This wasn't a big deal. Besides
being unlikely to happen, the result was simply that the
object was loosened and then pruned, missing the
optimization. Still, we can easily fix it while we are here.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reachable.c')
0 files changed, 0 insertions, 0 deletions