mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-10 08:22:54 -05:00
odb/source-inmemory: implement write_object() callback
Implement the `write_object()` callback function for the in-memory source. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
85daa55ed3
commit
3cf38cab06
@@ -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++];
|
||||
|
||||
Reference in New Issue
Block a user