aboutsummaryrefslogtreecommitdiffstats
path: root/odb.c
diff options
context:
space:
mode:
Diffstat (limited to 'odb.c')
-rw-r--r--odb.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/odb.c b/odb.c
index a2289ea97d..7201d01406 100644
--- a/odb.c
+++ b/odb.c
@@ -1038,16 +1038,8 @@ void odb_clear(struct object_database *o)
INIT_LIST_HEAD(&o->packed_git_mru);
close_object_store(o);
-
- /*
- * `close_object_store()` only closes the packfiles, but doesn't free
- * them. We thus have to do this manually.
- */
- for (struct packed_git *p = o->packed_git, *next; p; p = next) {
- next = p->next;
- free(p);
- }
- o->packed_git = NULL;
+ packfile_store_free(o->packfiles);
+ o->packfiles = NULL;
hashmap_clear(&o->pack_map);
string_list_clear(&o->submodule_source_paths, 0);