Re: [PATCH 2/5] builtin/multi-pack-index: get rid of `the_repository`
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Dec 1, 2026, 16:46 UTC
- Message-ID
- <aw74PSIwv5SLYbvl@denethor>
- In-Reply-To
- <aw6oSl_-1eyDrMYB@pks.im>
On 26/12/01 11:58AM, Patrick Steinhardt wrote:
Show 9 quoted lines
> On Mon, Nov 30, 2026 at 03:54:58PM -0600, Justin Tobler wrote: > > There are a couple of remaining references to `the_repository` in > > git-multi-pack-index(1). The command cannot run outside of a repository, > > so these references can be trivially replaced with the repository > > passed to the subcommands. > > Right, but only in the case where `repo` is not dereferenced before we > call `parse_options()`. You do pass it to `repo_config()`, which > (somewhat misleadingly) accepts `repo == NULL`.
That is correct. The repository could still be NULL here when running something like `git multi-pack-index -h` in which case would need to be handled by `parse_options()` first. I'll try to clarify the message slightly in the next version.
-Justin