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.