Re: [PATCH 03/27] object-store: move alt_odb_list and alt_odb_tail to object store
- From
- Brandon Williams <bmwill@google.com>
- Date
- Feb 22, 2018, 00:41 UTC
- Message-ID
- <20180222004127.GC127348@google.com>
- In-Reply-To
- <20180221015430.96054-4-sbeller@google.com>
On 02/20, Stefan Beller wrote:
Show 13 quoted lines
> 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>
Looks good aside from the one spacing issue (though it's not that big of a deal).
Show 26 quoted lines
> --- > builtin/fsck.c | 4 +++- > object-store.h | 9 ++++++--- > packfile.c | 3 ++- > sha1_file.c | 25 ++++++++++++------------- > sha1_name.c | 3 ++- > 5 files changed, 25 insertions(+), 19 deletions(-) > > diff --git a/builtin/fsck.c b/builtin/fsck.c > index 7a8a679d4f..908e4f092a 100644 > --- a/builtin/fsck.c > +++ b/builtin/fsck.c > @@ -1,5 +1,6 @@ > #include "builtin.h" > #include "cache.h" > +#include "repository.h" > #include "config.h" > #include "commit.h" > #include "tree.h" > @@ -716,7 +717,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) > fsck_object_dir(get_object_directory()); > > prepare_alt_odb(); > - for (alt = alt_odb_list; alt; alt = alt->next) > + for (alt = the_repository->objects.alt_odb_list; > + alt; alt = alt->next)
Indentation on this line looks odd.
-- Brandon Williams