diff options
author | Stefan Beller <sbeller@google.com> | 2018-05-08 12:37:35 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-09 12:12:37 +0900 |
commit | 341e45e46bba094ef1274957ef5891f43e91b344 (patch) | |
tree | 3312feb238421605093636d92fe4b4d3db2a518d /object.c | |
parent | 346a817a7271b58811a8004fa225ab88bc94e9c3 (diff) | |
download | git-341e45e46bba094ef1274957ef5891f43e91b344.tar.gz |
object: allow create_object to handle arbitrary repositories
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -139,7 +139,7 @@ static void grow_object_hash(struct repository *r) r->parsed_objects->obj_hash_size = new_hash_size; } -void *create_object_the_repository(const unsigned char *sha1, void *o) +void *create_object(struct repository *r, const unsigned char *sha1, void *o) { struct object *obj = o; @@ -147,12 +147,12 @@ void *create_object_the_repository(const unsigned char *sha1, void *o) obj->flags = 0; hashcpy(obj->oid.hash, sha1); - if (the_repository->parsed_objects->obj_hash_size - 1 <= the_repository->parsed_objects->nr_objs * 2) - grow_object_hash(the_repository); + if (r->parsed_objects->obj_hash_size - 1 <= r->parsed_objects->nr_objs * 2) + grow_object_hash(r); - insert_obj_hash(obj, the_repository->parsed_objects->obj_hash, - the_repository->parsed_objects->obj_hash_size); - the_repository->parsed_objects->nr_objs++; + insert_obj_hash(obj, r->parsed_objects->obj_hash, + r->parsed_objects->obj_hash_size); + r->parsed_objects->nr_objs++; return obj; } |