Skip to content
  • Vicent Marti's avatar
    pack-objects: refactor the packing list · 2834bc27
    Vicent Marti authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The hash table that stores the packing list for a given `pack-objects`
    run was tightly coupled to the pack-objects code.
    
    In this commit, we refactor the hash table and the underlying storage
    array into a `packing_data` struct. The functionality for accessing and
    adding entries to the packing list is hence accessible from other parts
    of Git besides the `pack-objects` builtin.
    
    This refactoring is a requirement for further patches in this series
    that will require accessing the commit packing list from outside of
    `pack-objects`.
    
    The hash table implementation has been minimally altered: we now
    use table sizes which are always a power of two, to ensure a uniform
    index distribution in the array.
    
    Signed-off-by: default avatarVicent Marti <tanoku@gmail.com>
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    2834bc27