From: Patrick Steinhardt Date: Mon, 17 Feb 2025 06:55:49 GMT Subject: Re: [PATCH 5/7] builtin/ls-files: stop using `the_repository` Message-ID: In-Reply-To: <20250214230210.1460111-6-usmanakinyemi202@gmail.com> 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