]> git.ipfire.org Git - thirdparty/git.git/commit - tmp-objdir.c
tmp-objdir: introduce API for temporary object directories
authorJeff King <peff@peff.net>
Mon, 3 Oct 2016 20:49:11 +0000 (16:49 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Oct 2016 20:54:02 +0000 (13:54 -0700)
commit2564d994c9c91aea58d59565d68d42bbc017f536
tree862d782736c08245b5b90f0e25f86a4988f8d92d
parent526f108a271b331af9ae92796215e560e5ec4677
tmp-objdir: introduce API for temporary object directories

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: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
tmp-objdir.c [new file with mode: 0644]
tmp-objdir.h [new file with mode: 0644]