File tree Expand file tree Collapse file tree 6 files changed +14
-7
lines changed Expand file tree Collapse file tree 6 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
#include "cache.h"
2
2
#include "blob.h"
3
+ #include "repository.h"
3
4
4
5
const char * blob_type = "blob" ;
5
6
6
7
struct blob * lookup_blob (const struct object_id * oid )
7
8
{
8
9
struct object * obj = lookup_object (oid -> hash );
9
10
if (!obj )
10
- return create_object (oid -> hash , alloc_blob_node ());
11
+ return create_object (the_repository , oid -> hash ,
12
+ alloc_blob_node ());
11
13
return object_as_type (obj , OBJ_BLOB , 0 );
12
14
}
13
15
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ struct commit *lookup_commit(const struct object_id *oid)
50
50
{
51
51
struct object * obj = lookup_object (oid -> hash );
52
52
if (!obj )
53
- return create_object (oid -> hash , alloc_commit_node ());
53
+ return create_object (the_repository , oid -> hash ,
54
+ alloc_commit_node ());
54
55
return object_as_type (obj , OBJ_COMMIT , 0 );
55
56
}
56
57
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ static void grow_object_hash(void)
138
138
the_repository -> parsed_objects -> obj_hash_size = new_hash_size ;
139
139
}
140
140
141
- void * create_object (const unsigned char * sha1 , void * o )
141
+ void * create_object_the_repository (const unsigned char * sha1 , void * o )
142
142
{
143
143
struct object * obj = o ;
144
144
@@ -178,7 +178,8 @@ struct object *lookup_unknown_object(const unsigned char *sha1)
178
178
{
179
179
struct object * obj = lookup_object (sha1 );
180
180
if (!obj )
181
- obj = create_object (sha1 , alloc_object_node ());
181
+ obj = create_object (the_repository , sha1 ,
182
+ alloc_object_node ());
182
183
return obj ;
183
184
}
184
185
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ extern struct object *get_indexed_object(unsigned int);
93
93
*/
94
94
struct object * lookup_object (const unsigned char * sha1 );
95
95
96
- extern void * create_object (const unsigned char * sha1 , void * obj );
96
+ #define create_object (r , s , o ) create_object_##r(s, o)
97
+ extern void * create_object_the_repository (const unsigned char * sha1 , void * obj );
97
98
98
99
void * object_as_type (struct object * obj , enum object_type type , int quiet );
99
100
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ struct tag *lookup_tag(const struct object_id *oid)
93
93
{
94
94
struct object * obj = lookup_object (oid -> hash );
95
95
if (!obj )
96
- return create_object (oid -> hash , alloc_tag_node ());
96
+ return create_object (the_repository , oid -> hash ,
97
+ alloc_tag_node ());
97
98
return object_as_type (obj , OBJ_TAG , 0 );
98
99
}
99
100
Original file line number Diff line number Diff line change @@ -196,7 +196,8 @@ struct tree *lookup_tree(const struct object_id *oid)
196
196
{
197
197
struct object * obj = lookup_object (oid -> hash );
198
198
if (!obj )
199
- return create_object (oid -> hash , alloc_tree_node ());
199
+ return create_object (the_repository , oid -> hash ,
200
+ alloc_tree_node ());
200
201
return object_as_type (obj , OBJ_TREE , 0 );
201
202
}
202
203
You can’t perform that action at this time.
0 commit comments