Re: [PATCH v3 8/8] builtin/checkout-index: stop using `the_repository`

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

 



On Thu, Mar 6, 2025 at 11:48 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Usman Akinyemi <usmanakinyemi202@xxxxxxxxx> writes:
>
> > Remove the_repository global variable in favor of the repository
> > argument that gets passed in "builtin/checkout-index.c".
> >
> > When `-h` is passed to the command outside a Git repository, the
> > `run_builtin()` will call the `cmd_checkout_index()` function with `repo`
> > set to NULL and then early in the function, `show_usage_with_options_if_asked()`
> > call will give the options help and exit.
> >
> > Pass the repository available in the calling context to both `checkout_all()`
> > and `checkout_file()` to remove their dependency on the global
> > `the_repository` variable.
>
> Hmph, if we are passing anything down to these code paths, I would
> have expected that it would be an instance of "struct index_state".
>
> Do these two helper functions need anything other than that from the
> repository instance?
No, they do not. They could possibly do in the future and is there any
reason why we might want to pass the "struct index_state" instead of
the whole "struct repository" ?



>
> Other than that, I think this step does look great.
>
> Will queue.
>
> Thanks.





[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