On Wed, Mar 13, 2019 at 5:28 AM Junio C Hamano <gits...@pobox.com> wrote:
>
> Christian Couder <christian.cou...@gmail.com> writes:
>
> > From: Christian Couder <christian.cou...@gmail.com>
> >
> > We will need to reinitialize the promisor remote configuration
> > as we will make some changes to it in a later commit.
> >
> > Signed-off-by: Christian Couder <chrisc...@tuxfamily.org>
> > ---
>
> At this point, turning "initialized" into a file-scope static, and
> building reinit as
>
>         void promisor_remote_reinit(void)
>         {
>                 initialized = 0;
>                 ... clear existing "promisor" entries ...
>                 promisor_remote_init();
>         }
>
> may make more sense.

Ok, I implemented that.

> > -static void promisor_remote_init(void)
> > +static void promisor_remote_do_init(int force)
> >  {
> >       static int initialized;
> >
> > -     if (initialized)
> > +     if (!force && initialized)
> >               return;
> >       initialized = 1;
> >
> >       git_config(promisor_remote_config, NULL);
>
> The promisors and promisors_tail would need to be reinitiazlied and
> existing elements on the list purged.  Otherwise, after removing an
> entry from the configuration file, the entry will still stay around.

Yeah, that's in the new version too.

> >  }

Reply via email to