On 02/26, Junio C Hamano wrote: > Duy Nguyen <pclouds@xxxxxxxxx> writes: > > > diff --git a/common-main.c b/common-main.c > > index 6a689007e7..a13ab981aa 100644 > > --- a/common-main.c > > +++ b/common-main.c > > @@ -1,6 +1,7 @@ > > #include "cache.h" > > #include "exec_cmd.h" > > #include "attr.h" > > +#include "repository.h" > > > > /* > > * Many parts of Git have subprograms communicate via pipe, expect the > > @@ -32,6 +33,8 @@ int main(int argc, const char **argv) > > */ > > sanitize_stdfds(); > > > > + init_the_repository(); > > + > > git_setup_gettext(); > > ... > > +void init_the_repository(void) > > +{ > > + the_repository = &the_repo; > > + repo_pre_init(the_repository); > > + the_repository->index = &the_index; > > + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); > > +} > > I see what you did here, and I like it. I thought this would be a good idea to do eventually but back when I first introduced struct repository there wasn't enough to justify it till now. This definitely makes it much easier to read the initialization and I prefer this over the initializer. Thanks for working on this :) -- Brandon Williams