]> git.ipfire.org Git - thirdparty/git.git/commit
object-file: remove flags from transaction packfile writes
authorJustin Tobler <jltobler@gmail.com>
Thu, 14 May 2026 18:37:37 +0000 (13:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 May 2026 19:44:40 +0000 (04:44 +0900)
commit8a1f5ecf287bf73c2dee102d726709f444b77c44
tree50a739bc5885a8ec3db3d807ec4d4937f7b477cf
parent970f63519e494b590c807972af6c40477e14bc61
object-file: remove flags from transaction packfile writes

The `index_blob_packfile_transaction()` function handles streaming a
blob from an fd to compute its object ID and conditionally writes the
object directly to a packfile if the INDEX_WRITE_OBJECT flag is set. A
subsequent commit will make these packfile object writes part of the
transaction interface. Consequently, having the object write be
conditional on this flag is a bit awkward.

In preparation for this change, introduce a dedicated
`hash_blob_stream()` helper that only computes the OID from a `struct
odb_write_stream`. This is invoked by `index_fd()` instead when the
INDEX_WRITE_OBJECT is not set. The object write performed via
`index_blob_packfile_transaction()` is made unconditional accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c
odb/streaming.c
odb/streaming.h