Skip to content

Commit

Permalink
object: add repository argument to grow_object_hash
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jrn authored and gitster committed May 9, 2018
1 parent 68f95d3 commit c077a45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions object.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ struct object *lookup_object(const unsigned char *sha1)
* power of 2 (but at least 32). Copy the existing values to the new
* hash map.
*/
static void grow_object_hash(void)
#define grow_object_hash(r) grow_object_hash_##r()
static void grow_object_hash_the_repository(void)
{
int i;
/*
Expand Down Expand Up @@ -147,7 +148,7 @@ void *create_object_the_repository(const unsigned char *sha1, void *o)
hashcpy(obj->oid.hash, sha1);

if (the_repository->parsed_objects->obj_hash_size - 1 <= the_repository->parsed_objects->nr_objs * 2)
grow_object_hash();
grow_object_hash(the_repository);

insert_obj_hash(obj, the_repository->parsed_objects->obj_hash,
the_repository->parsed_objects->obj_hash_size);
Expand Down

0 comments on commit c077a45

Please sign in to comment.