remote: convert get_ref_match to take a struct refspec
[gitweb.git] / alloc.c
diff --git a/alloc.c b/alloc.c
index fd2e32df8c472d36043e0a389f5022b990600f77..cf4f8b61e126c0e9992dc34c6cb52b6f896a565d 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -82,12 +82,18 @@ void *alloc_object_node(void)
 
 static struct alloc_state commit_state;
 
+unsigned int alloc_commit_index(void)
+{
+       static unsigned int count;
+       return count++;
+}
+
 void *alloc_commit_node(void)
 {
-       static int commit_count;
        struct commit *c = alloc_node(&commit_state, sizeof(struct commit));
        c->object.type = OBJ_COMMIT;
-       c->index = commit_count++;
+       c->index = alloc_commit_index();
+       c->graph_pos = COMMIT_NOT_FROM_GRAPH;
        return c;
 }