alloc: add repository argument to alloc_commit_index
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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
17bfe87369
commit
dd5d9deb01
4
alloc.c
4
alloc.c
@ -82,7 +82,7 @@ void *alloc_object_node_the_repository(void)
|
||||
|
||||
static struct alloc_state commit_state;
|
||||
|
||||
unsigned int alloc_commit_index(void)
|
||||
unsigned int alloc_commit_index_the_repository(void)
|
||||
{
|
||||
static unsigned int count;
|
||||
return count++;
|
||||
@ -92,7 +92,7 @@ void *alloc_commit_node_the_repository(void)
|
||||
{
|
||||
struct commit *c = alloc_node(&commit_state, sizeof(struct commit));
|
||||
c->object.type = OBJ_COMMIT;
|
||||
c->index = alloc_commit_index();
|
||||
c->index = alloc_commit_index(the_repository);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user