summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2018-07-11 22:42:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-17 22:47:48 (GMT)
commit8527750626f8a1b0fe641a5163760be054cc1d64 (patch)
tree38cc0bee20fbe5e7da17212ae9594211a9ba00dd /object.c
parentc3756d5b7fc6e163032296aa6c10fad2589273dc (diff)
downloadgit-8527750626f8a1b0fe641a5163760be054cc1d64.zip
git-8527750626f8a1b0fe641a5163760be054cc1d64.tar.gz
git-8527750626f8a1b0fe641a5163760be054cc1d64.tar.bz2
commit-graph: store graph in struct object_store
Instead of storing commit graphs in static variables, store them in struct object_store. There are no changes to the signatures of existing functions - they all still only support the_repository, and support for other instances of struct repository will be added in a subsequent commit. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/object.c b/object.c
index b0faab8..e2c112c 100644
--- a/object.c
+++ b/object.c
@@ -9,6 +9,7 @@
#include "alloc.h"
#include "object-store.h"
#include "packfile.h"
+#include "commit-graph.h"
unsigned int get_max_object_index(void)
{
@@ -507,6 +508,10 @@ void raw_object_store_clear(struct raw_object_store *o)
oidmap_free(o->replace_map, 1);
FREE_AND_NULL(o->replace_map);
+ free_commit_graph(o->commit_graph);
+ o->commit_graph = NULL;
+ o->commit_graph_attempted = 0;
+
free_alt_odbs(o);
o->alt_odb_tail = NULL;