]> git.ipfire.org Git - thirdparty/git.git/commit
odb: introduce `odb_write_object()`
authorPatrick Steinhardt <ps@pks.im>
Thu, 17 Jul 2025 04:56:35 +0000 (06:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Jul 2025 05:16:15 +0000 (22:16 -0700)
commitab1c6e1d12e869cbca3ea7f8a4e767e45fd14c49
tree32a6815af9b9ec50578da260882e52ab9de8182f
parent0f9b18935745fcdebcad613a6e3e52db5b29b1d4
odb: introduce `odb_write_object()`

We do not have a backend-agnostic way to write objects into an object
database. While there is `write_object_file()`, this function is rather
specific to the loose object format.

Introduce `odb_write_object()` to plug this gap. For now, this function
is a simple wrapper around `write_object_file()` and doesn't even use
the passed-in object database yet. This will change in subsequent
commits, where `write_object_file()` is converted so that it works on
top of an `odb_source`. `odb_write_object()` will then become
responsible for deciding which source an object shall be written to.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 files changed:
apply.c
builtin/checkout.c
builtin/merge-file.c
builtin/mktag.c
builtin/mktree.c
builtin/notes.c
builtin/receive-pack.c
builtin/replace.c
builtin/tag.c
builtin/unpack-objects.c
cache-tree.c
commit.c
match-trees.c
merge-ort.c
notes-cache.c
notes.c
object-file.c
object-file.h
odb.c
odb.h
read-cache.c