Skip to content
  • Jeff King's avatar
    fast-import: simplify allocation in start_packfile · a78c188a
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    This function allocate a packed_git flex-array, and adds a
    mysterious 2 bytes to the length of the pack_name field. One
    is for the trailing NUL, but the other has no purpose. This
    is probably cargo-culted from add_packed_git, which gets the
    ".idx" path and needed to allocate enough space to hold the
    matching ".pack" (though since 48bcc1c3
    
    , we calculate the
    size there differently).
    
    This site, however, is using the raw path of a tempfile, and
    does not need the extra byte. We can just replace the
    allocation with FLEX_ALLOC_STR, which handles the allocation
    and the NUL for us.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a78c188a