From: Derrick Stolee Date: Tue, 10 Jan 2023 15:09:54 GMT Subject: Re: [PATCH 0/5] cache API: always have a "istate->repo" Message-ID: <84705c15-803f-3062-8a02-474eb1eb053a@github.com> In-Reply-To: On 1/10/2023 1:17 AM, Ævar Arnfjörð Bjarmason wrote: > The "struct index_state" contains a "repo" member, which should be a > pointer to the repository for that index, but which due to us > constructing such structs on an ad-hoc basis in various places wasn't > always available. > > We'd thus end up with code like this, in the recent > ds/omit-trailing-hash-in-index topic: > > struct repository *r = istate->repo ? istate->repo : the_repository; > > Really we should be able to trust the "istate->repo", but were > carrying those sorts of conditionals because our index might come from > a manually constructed source, so we'd have to fall back to > "the_repository". > > This series changes the relvant code so the "repo" field is always > non-NULL, as 5/5 here shows we had various workarounds in place for > that, which can now go away. Thanks for these changes. I only had a recommended change for Patch 3, along with Philip's recommended commit message fixup. Glad to wrap up this tech debt. Thanks, -Stolee