aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/merge-file.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-17 06:56:35 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-16 22:16:15 -0700
commitab1c6e1d12e869cbca3ea7f8a4e767e45fd14c49 (patch)
tree32a6815af9b9ec50578da260882e52ab9de8182f /builtin/merge-file.c
parentloose: write loose objects map via their source (diff)
downloadgit-ab1c6e1d12e869cbca3ea7f8a4e767e45fd14c49.tar.gz
git-ab1c6e1d12e869cbca3ea7f8a4e767e45fd14c49.zip
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 'builtin/merge-file.c')
-rw-r--r--builtin/merge-file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index 9464f27562..b8b25a14e6 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -155,7 +155,8 @@ int cmd_merge_file(int argc,
if (object_id && !to_stdout) {
struct object_id oid;
if (result.size) {
- if (write_object_file(result.ptr, result.size, OBJ_BLOB, &oid) < 0)
+ if (odb_write_object(the_repository->objects, result.ptr,
+ result.size, OBJ_BLOB, &oid) < 0)
ret = error(_("Could not write object file"));
} else {
oidcpy(&oid, the_hash_algo->empty_blob);