Re: [PATCHv4 01/27] repository: introduce raw object store field
- From
- Brandon Williams <bmwill@google.com>
- Date
- Feb 26, 2018, 18:23 UTC
- Message-ID
- <20180226182324.GA60857@google.com>
- In-Reply-To
- <xmqqo9kbr4u7.fsf@gitster-ct.c.googlers.com>
On 02/26, Junio C Hamano wrote:
Show 31 quoted lines
> Duy Nguyen <pclouds@gmail.com> 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