diff options
author | Stefan Beller <sbeller@google.com> | 2018-03-23 20:20:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-23 21:06:01 +0300 |
commit | 031dc927f443fa5274e794c12ac34f19a0e0d318 (patch) | |
tree | 07acd9769fb07037595e1ac0643984f43c8b3641 /packfile.c | |
parent | 0d4a132144a14ae6801523960cbc1939a9bab6c1 (diff) |
object-store: move alt_odb_list and alt_odb_tail to object store
In a process with multiple repositories open, alternates should be
associated to a single repository and not shared globally. Move
alt_odb_list and alt_odb_tail into the_repository and adjust callers
to reflect this.
Now that the alternative object data base is per repository, we're
leaking its memory upon freeing a repository. The next patch plugs
this hole.
No functional change intended.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r-- | packfile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packfile.c b/packfile.c index c6651682a7..fdbf240f81 100644 --- a/packfile.c +++ b/packfile.c @@ -1,6 +1,7 @@ #include "cache.h" #include "list.h" #include "pack.h" +#include "repository.h" #include "dir.h" #include "mergesort.h" #include "packfile.h" @@ -892,7 +893,7 @@ void prepare_packed_git(void) return; prepare_packed_git_one(get_object_directory(), 1); prepare_alt_odb(); - for (alt = alt_odb_list; alt; alt = alt->next) + for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next) prepare_packed_git_one(alt->path, 0); rearrange_packed_git(); prepare_packed_git_mru(); |