X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=alloc.c;h=1c64c4dd1629c63a8bb2fff6e580ee0c648a0730;hb=0454220d66581f28b9688bc1b687f52cb9561798;hp=e7aa81b7aa48c14f2a98894eb6e8c2e28998945e;hpb=544d114eb2ec2fbc7be123ef29492e87c760f4c3;p=thirdparty%2Fgit.git diff --git a/alloc.c b/alloc.c index e7aa81b7aa..1c64c4dd16 100644 --- a/alloc.c +++ b/alloc.c @@ -99,18 +99,23 @@ void *alloc_object_node(struct repository *r) return obj; } -unsigned int alloc_commit_index(struct repository *r) +static unsigned int alloc_commit_index(struct repository *r) { return r->parsed_objects->commit_count++; } -void *alloc_commit_node(struct repository *r) +void init_commit_node(struct repository *r, struct commit *c) { - struct commit *c = alloc_node(r->parsed_objects->commit_state, sizeof(struct commit)); c->object.type = OBJ_COMMIT; c->index = alloc_commit_index(r); c->graph_pos = COMMIT_NOT_FROM_GRAPH; c->generation = GENERATION_NUMBER_INFINITY; +} + +void *alloc_commit_node(struct repository *r) +{ + struct commit *c = alloc_node(r->parsed_objects->commit_state, sizeof(struct commit)); + init_commit_node(r, c); return c; }