]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/receive-pack: stage incoming objects via ODB transactions
authorJustin Tobler <jltobler@gmail.com>
Fri, 10 Jul 2026 16:37:22 +0000 (11:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2026 20:21:53 +0000 (13:21 -0700)
commitbdee7b30135f51f406d71c565cf29bb7db64f1cd
treef414fce9fa24f5ea4402e272d557722f40afcf77
parent6c242569c190ec5c53b015d5284180b37f5b1542
builtin/receive-pack: stage incoming objects via ODB transactions

Objects received by git-receive-pack(1) are quarantined in a temporary
"incoming" directory and migrated into the object database prior to the
reference updates. The quarantine is currently managed through
`tmp_objdir` directly. In a pluggable ODB future, how exactly an object
gets written to a transaction may vary for a given ODB source. Refactor
git-receive-pack(1) to use the ODB transaction interfaces to manage the
object staging area in a more agnostic manner accordingly.

Note that the ODB transaction is now responsible for managing the
primary and alternate ODBs for the repository. One small change as a
result is that the temporary directory is now applied as the primary ODB
in the main process instead of an alternate. This does not change
anything for git-receive-pack(1) though because it only needs access to
the newly written objects and doesn't care how exactly it is set up.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c