Re: [PATCH v3 8/8] builtin/checkout-index: stop using `the_repository`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 6, 2025, 18:18 UTC
- Message-ID
- <xmqqzfhyggzb.fsf@gitster.g>
- In-Reply-To
- <20250306143629.1267358-9-usmanakinyemi202@gmail.com>
Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
Show 11 quoted lines
> 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?
Other than that, I think this step does look great.
Will queue.
Thanks.