object: add repository argument to grow_object_hash
Add a repository argument to allow the caller of grow_object_hash to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. 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>
Jonathan Nieder committed
May 8, 2018 at 12:37 UTC
c077a4526ba456ada28d16db9c945afd9a4a57de
1 file changed
+3
-2
object.c
+3
-2
@@ -116,7 +116,8 @@ struct object *lookup_object(const unsigned char *sha1)
116
* power of 2 (but at least 32). Copy the existing values to the new
117
* hash map.
118
*/
119
-static void grow_object_hash(void)
119
+#define grow_object_hash(r) grow_object_hash_##r()
120
+static void grow_object_hash_the_repository(void)
121
{
122
int i;
123
/*
@@ -147,7 +148,7 @@ void *create_object_the_repository(const unsigned char *sha1, void *o)
148
hashcpy(obj->oid.hash, sha1);
149
150
if (the_repository->parsed_objects->obj_hash_size - 1 <= the_repository->parsed_objects->nr_objs * 2)
150
- grow_object_hash();
151
+ grow_object_hash(the_repository);
152
153
insert_obj_hash(obj, the_repository->parsed_objects->obj_hash,
154
the_repository->parsed_objects->obj_hash_size);