• Jeff King's avatar
    pack-revindex: store entries directly in packed_git · 9d98bbf5
    Jeff King authored
    A pack_revindex struct has two elements: the revindex
    entries themselves, and a pointer to the packed_git. We need
    both to do lookups, because only the latter knows things
    like the number of objects in the pack.
    Now that packed_git contains the pack_revindex struct it's
    just as easy to pass around the packed_git itself, and we do
    not need the extra back-pointer.
    We can instead just store the entries directly in the pack.
    All functions which took a pack_revindex now just take a
    packed_git. We still lazy-load in find_pack_revindex, so
    most callers are unaffected.
    The exception is the bitmap code, which computes the
    revindex and caches the pointer when we load the bitmaps. We
    can continue to load, drop the extra cache pointer, and just
    access bitmap_git.pack.revindex directly.
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
pack-revindex.h 323 Bytes