Re: [PATCH 2/5] builtin/multi-pack-index: get rid of `the_repository`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 1, 2026, 10:58 UTC
- Message-ID
- <aw6oSl_-1eyDrMYB@pks.im>
- In-Reply-To
- <673945d65de346762178b675ad6d0de9606cc6ca.1796075503.git.jltobler@gmail.com>
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`.
> diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c > index 1a27d523c7ab..8528f4f513ef 100644 > --- a/builtin/multi-pack-index.c > +++ b/builtin/multi-pack-index.c
All of the conversions look fine to me, as there are no new callsites that dereference the repository before `parse_options()`.
Patrick