@@ -84,21 +84,20 @@ static void insert_obj_hash(struct object *obj, struct object **hash, unsigned i
84
84
* Look up the record for the given sha1 in the hash map stored in
85
85
* obj_hash. Return NULL if it was not found.
86
86
*/
87
- struct object * lookup_object_the_repository ( const unsigned char * sha1 )
87
+ struct object * lookup_object ( struct repository * r , const unsigned char * sha1 )
88
88
{
89
89
unsigned int i , first ;
90
90
struct object * obj ;
91
91
92
- if (!the_repository -> parsed_objects -> obj_hash )
92
+ if (!r -> parsed_objects -> obj_hash )
93
93
return NULL ;
94
94
95
- first = i = hash_obj (sha1 ,
96
- the_repository -> parsed_objects -> obj_hash_size );
97
- while ((obj = the_repository -> parsed_objects -> obj_hash [i ]) != NULL ) {
95
+ first = i = hash_obj (sha1 , r -> parsed_objects -> obj_hash_size );
96
+ while ((obj = r -> parsed_objects -> obj_hash [i ]) != NULL ) {
98
97
if (!hashcmp (sha1 , obj -> oid .hash ))
99
98
break ;
100
99
i ++ ;
101
- if (i == the_repository -> parsed_objects -> obj_hash_size )
100
+ if (i == r -> parsed_objects -> obj_hash_size )
102
101
i = 0 ;
103
102
}
104
103
if (obj && i != first ) {
@@ -107,8 +106,8 @@ struct object *lookup_object_the_repository(const unsigned char *sha1)
107
106
* that we do not need to walk the hash table the next
108
107
* time we look for it.
109
108
*/
110
- SWAP (the_repository -> parsed_objects -> obj_hash [i ],
111
- the_repository -> parsed_objects -> obj_hash [first ]);
109
+ SWAP (r -> parsed_objects -> obj_hash [i ],
110
+ r -> parsed_objects -> obj_hash [first ]);
112
111
}
113
112
return obj ;
114
113
}
0 commit comments