• Jeff King's avatar
    tmp-objdir: introduce API for temporary object directories · 2564d994
    Jeff King authored
    Once objects are added to the object database by a process,
    they cannot easily be deleted, as we don't know what other
    processes may have started referencing them. We have to
    clean them up with git-gc, which will apply the usual
    reachability and grace-period checks.
    
    This patch provides an alternative: it helps callers create
    a temporary directory inside the object directory, and a
    temporary environment which can be passed to sub-programs to
    ask them to write there (the original object directory
    remains accessible as an alternate of the temporary one).
    
    See tmp-objdir.h for details on the API.
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    2564d994
tmp-objdir.h 1.53 KB