Skip to content

Commit a0bd908

Browse files
stefanbellergitster
authored andcommitted
alloc: add repository argument to alloc_tag_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 8ba0e5e commit a0bd908

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
@@ -65,7 +65,7 @@ void *alloc_tree_node_the_repository(void)
6565
}
6666

6767
static struct alloc_state tag_state;
68-
void *alloc_tag_node(void)
68+
void *alloc_tag_node_the_repository(void)
6969
{
7070
struct tag *t = alloc_node(&tag_state, sizeof(struct tag));
7171
t->object.type = OBJ_TAG;

cache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,8 @@ extern void *alloc_blob_node_the_repository(void);
17701770
extern void *alloc_tree_node_the_repository(void);
17711771
#define alloc_commit_node(r) alloc_commit_node_##r()
17721772
extern void *alloc_commit_node_the_repository(void);
1773-
extern void *alloc_tag_node(void);
1773+
#define alloc_tag_node(r) alloc_tag_node_##r()
1774+
extern void *alloc_tag_node_the_repository(void);
17741775
extern void *alloc_object_node(void);
17751776
extern void alloc_report(void);
17761777
extern unsigned int alloc_commit_index(void);

tag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct tag *lookup_tag(const struct object_id *oid)
9494
struct object *obj = lookup_object(oid->hash);
9595
if (!obj)
9696
return create_object(the_repository, oid->hash,
97-
alloc_tag_node());
97+
alloc_tag_node(the_repository));
9898
return object_as_type(obj, OBJ_TAG, 0);
9999
}
100100

0 commit comments

Comments
 (0)