aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-15 13:22:14 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-15 13:22:14 -0700
commit88457a6151ca7bd46ce1a809f9740340b712e242 (patch)
treebc108eecd535ff369dddb3b04bd2be3e21d82d6d /object.c
parentMerge branch 'ag/t7004-modernize' (diff)
parentobject: fix leaking packfiles when closing object store (diff)
downloadgit-88457a6151ca7bd46ce1a809f9740340b712e242.tar.gz
git-88457a6151ca7bd46ce1a809f9740340b712e242.zip
Merge branch 'ps/submodule-ref-format'
Support to specify ref backend for submodules has been enhanced. * ps/submodule-ref-format: object: fix leaking packfiles when closing object store submodule: fix leaking seen submodule names submodule: fix leaking fetch tasks builtin/submodule: allow "add" to use different ref storage format refs: fix ref storage format for submodule ref stores builtin/clone: propagate ref storage format to submodules builtin/submodule: allow cloning with different ref storage format git-submodule.sh: break overly long command lines
Diffstat (limited to 'object.c')
-rw-r--r--object.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/object.c b/object.c
index 0c0fcb76c0..d756c7f2ea 100644
--- a/object.c
+++ b/object.c
@@ -614,6 +614,15 @@ void raw_object_store_clear(struct raw_object_store *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;
hashmap_clear(&o->pack_map);