[PATCH v2 07/17] odb/source-inmemory: implement `write_object()` callback
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 9, 2026, 07:24 UTC
- Message-ID
- <20260409-b4-pks-odb-source-inmemory-v2-7-f02b4f1c0f13@pks.im>
- In-Reply-To
- <20260409-b4-pks-odb-source-inmemory-v2-0-f02b4f1c0f13@pks.im>
Implement the `write_object()` callback function for the in-memory source.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- odb/source-inmemory.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/odb/source-inmemory.c b/odb/source-inmemory.c index d2fc4c4054..96e8efd327 100644 --- a/odb/source-inmemory.c +++ b/odb/source-inmemory.c @@ -1,4 +1,5 @@ #include "git-compat-util.h" +#include "object-file.h" #include "odb.h" #include "odb/source-inmemory.h" #include "odb/streaming.h" @@ -112,6 +113,8 @@ static int odb_source_inmemory_write_object(struct odb_source *source, struct odb_source_inmemory *inmemory = odb_source_inmemory_downcast(source); struct cached_object_entry *object; + hash_object_file(source->odb->repo->hash_algo, buf, len, type, oid); + ALLOC_GROW(inmemory->objects, inmemory->objects_nr + 1, inmemory->objects_alloc); object = &inmemory->objects[inmemory->objects_nr++];
-- 2.54.0.rc0.680.geaeac8ef83.dirty