Subject: Re: [PATCH 5/7] builtin/ls-files: stop using `the_repository`

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 17 Feb 2025 07:55:49 +0100

On Sat, Feb 15, 2025 at 04:27:21AM +0530, Usman Akinyemi wrote:
> Remove the_repository global variable in favor of the repository
> argument that gets passed in "builtin/ls-files.c".
> 
> When `-h` is passed to the command outside a Git repository, the
> `run_builtin()` will call the `cmd_ls_files()` 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, without having to consult much
> of the configuration file.
> 
> Let's pass `repository` argument to `expand_objectsize()`,
> `show_ru_info()` functions to remove their dependency on the global
> `the_repository` variable.

This paragraph made my reading hickup a bit. How about:

    Pass the repository available in the calling context to both
    `expand_objectsize()` and `show_ru_info()` to remove their
    dependency on the global `the_repository` variable.

Patrick