diff options
author | Taylor Blau <me@ttaylorr.com> | 2023-05-08 19:38:06 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-08 21:05:55 +0200 |
commit | fe90355361430dc52f858845a821370db0c54c80 (patch) | |
tree | 0305ffe40554f02b6ed4316b1aa1dc2b2894141a /object.c | |
parent | Merge branch 'tb/enable-cruft-packs-by-default' (diff) | |
download | git-fe90355361430dc52f858845a821370db0c54c80.tar.xz git-fe90355361430dc52f858845a821370db0c54c80.zip |
object: add object_array initializer helper function
The object_array API has an OBJECT_ARRAY_INIT macro, but lacks a
function to initialize an object_array at a given location in memory.
Introduce `object_array_init()` to implement such a function.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -356,6 +356,12 @@ void object_list_free(struct object_list **list) */ static char object_array_slopbuf[1]; +void object_array_init(struct object_array *array) +{ + struct object_array blank = OBJECT_ARRAY_INIT; + memcpy(array, &blank, sizeof(*array)); +} + void add_object_array_with_path(struct object *obj, const char *name, struct object_array *array, unsigned mode, const char *path) |