summaryrefslogtreecommitdiff
path: root/alloc.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-05-08 19:37:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-09 03:12:36 (GMT)
commitdd5d9deb0155a27cb2d74d1a0faf0af84ef5f355 (patch)
tree9be9ce4fda0e7b0d5ea7b1f9655897f24513f929 /alloc.c
parent17bfe87369a726ebf3b1156ffd38c014bbd67e88 (diff)
downloadgit-dd5d9deb0155a27cb2d74d1a0faf0af84ef5f355.zip
git-dd5d9deb0155a27cb2d74d1a0faf0af84ef5f355.tar.gz
git-dd5d9deb0155a27cb2d74d1a0faf0af84ef5f355.tar.bz2
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>
Diffstat (limited to 'alloc.c')
-rw-r--r--alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/alloc.c b/alloc.c
index 28b85b2..277dadd 100644
--- a/alloc.c
+++ b/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;
}