• Jeff King's avatar
    archive: pass archiver struct to write_archive callback · 4d7c9898
    Jeff King authored
    The current archivers are very static; when you are in the
    write_tar_archive function, you know you are writing a tar.
    However, to facilitate runtime-configurable archivers
    that will share a common write function we need to tell the
    function which archiver was used.
    As a convenience, we also provide an opaque data pointer in
    the archiver struct so that individual archivers can put
    something useful there when they register themselves.
    Technically they could just use the "name" field to look in
    an internal map of names to data, but this is much simpler.
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
archive-tar.c 6.41 KB