Skip to content

Commit c077a45

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 68f95d3 commit c077a45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

object.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ struct object *lookup_object(const unsigned char *sha1)
116116
* power of 2 (but at least 32). Copy the existing values to the new
117117
* hash map.
118118
*/
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)
120121
{
121122
int i;
122123
/*
@@ -147,7 +148,7 @@ void *create_object_the_repository(const unsigned char *sha1, void *o)
147148
hashcpy(obj->oid.hash, sha1);
148149

149150
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);
151152

152153
insert_obj_hash(obj, the_repository->parsed_objects->obj_hash,
153154
the_repository->parsed_objects->obj_hash_size);

0 commit comments

Comments
 (0)