diff options
author | Patrick Steinhardt <ps@pks.im> | 2025-07-17 06:56:35 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-07-16 22:16:15 -0700 |
commit | ab1c6e1d12e869cbca3ea7f8a4e767e45fd14c49 (patch) | |
tree | 32a6815af9b9ec50578da260882e52ab9de8182f /commit.c | |
parent | 0f9b18935745fcdebcad613a6e3e52db5b29b1d4 (diff) |
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>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1797,8 +1797,8 @@ int commit_tree_extended(const char *msg, size_t msg_len, compat_oid = &compat_oid_buf; } - result = write_object_file_flags(buffer.buf, buffer.len, OBJ_COMMIT, - ret, compat_oid, 0); + result = odb_write_object_ext(the_repository->objects, buffer.buf, buffer.len, + OBJ_COMMIT, ret, compat_oid, 0); out: free(parent_buf); strbuf_release(&buffer); |