Re: [PATCH v3 04/11] promisor-remote: add promisor_remote_reinit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 13, 2019 at 5:28 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Christian Couder <christian.couder@xxxxxxxxx> writes:
>
> > From: Christian Couder <christian.couder@xxxxxxxxx>
> >
> > 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 <chriscool@xxxxxxxxxxxxx>
> > ---
>
> 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.

> >  }



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux