]> git.ipfire.org Git - thirdparty/git.git/commit
odb/transaction: introduce ODB transaction flags
authorJustin Tobler <jltobler@gmail.com>
Fri, 10 Jul 2026 16:37:20 +0000 (11:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2026 20:21:53 +0000 (13:21 -0700)
commit48d730a16a6f02ca952f653cf70d8c0471137112
treefb8db5989f9b958cb7ad4eb4e91a672863f142c2
parent28fbc0676936e2c024f3973066bec6b2bbfed610
odb/transaction: introduce ODB transaction flags

The temporary directory used by git-receive-pack(1) to write objects is
managed slightly differently than how it is done via ODB transactions:

  - The temporary directory is eagerly created upfront, instead of
    waiting for the first object write.

  - The prefix name of the temporary directory is "incoming" instead of
    "bulk-fsync".

In a subsequent commit, git-receive-pack(1) will use ODB transactions
instead of `tmp_objdir` directly. To provide a means to configure the
same transaction behavior, introduce `enum odb_transaction_flags` and
the ODB_TRANSACTION_RECEIVE flag intended as a signal for ODB
transactions using the "files" backend to be set up for
git-receive-pack(1). Transaction call sites are updated accordingly to
provide the required flag parameter.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 files changed:
builtin/add.c
builtin/unpack-objects.c
builtin/update-index.c
cache-tree.c
object-file.c
object-file.h
odb/source-files.c
odb/source-inmemory.c
odb/source-loose.c
odb/source.h
odb/transaction.c
odb/transaction.h
read-cache.c