Skip to content

Commit 13e3fdc

Browse files
stefanbellergitster
authored andcommitted
alloc: add repository argument to alloc_object_node
This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. Use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0bd908 commit 13e3fdc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void *alloc_tag_node_the_repository(void)
7373
}
7474

7575
static struct alloc_state object_state;
76-
void *alloc_object_node(void)
76+
void *alloc_object_node_the_repository(void)
7777
{
7878
struct object *obj = alloc_node(&object_state, sizeof(union any_object));
7979
obj->type = OBJ_NONE;

cache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,8 @@ extern void *alloc_tree_node_the_repository(void);
17721772
extern void *alloc_commit_node_the_repository(void);
17731773
#define alloc_tag_node(r) alloc_tag_node_##r()
17741774
extern void *alloc_tag_node_the_repository(void);
1775-
extern void *alloc_object_node(void);
1775+
#define alloc_object_node(r) alloc_object_node_##r()
1776+
extern void *alloc_object_node_the_repository(void);
17761777
extern void alloc_report(void);
17771778
extern unsigned int alloc_commit_index(void);
17781779

object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct object *lookup_unknown_object(const unsigned char *sha1)
180180
struct object *obj = lookup_object(sha1);
181181
if (!obj)
182182
obj = create_object(the_repository, sha1,
183-
alloc_object_node());
183+
alloc_object_node(the_repository));
184184
return obj;
185185
}
186186

0 commit comments

Comments
 (0)