mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
odb: move list of packfiles into struct packfile_store
The object database tracks the list of packfiles it currently knows about. With the introduction of the `struct packfile_store` we have a better place to host this list though. Move the list accordingly. Extract the logic from `odb_clear()` that knows to close all such packfiles and move it into the new subsystem, as well. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
b7983adb51
commit
535b7a667a
12
odb.c
12
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);
|
||||
|
||||
Reference in New Issue
Block a user