Re: [PATCH 3/4] odb: drop `loaded_alternates` field
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Aug 11, 2026, 22:22 UTC
- Message-ID
- <anufdy4UAqoLWPgG@denethor>
- In-Reply-To
- <20260810-pks-odb-eagerly-prepare-alternates-v1-3-f0fa4a4004e1@pks.im>
On 26/08/10 03:33PM, Patrick Steinhardt wrote:
Show 6 quoted lines
> The `struct object_database::loaded_alternates` field tells us whether > or not alternates have been loaded already. This field was useful before > the preceding commit as we were indeed lazy-loading alternates. But now > that we started to eagerly load them we can assume them to be loaded > after `odb_new()`, and hence the field does not serve any purpose > anymore.
Now that alternates are eagerly set up, it is safe to assume, if we have an ODB, the alternates have been loaded. Makes sense.
> Remove it. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > ---
[snip]
Show 6 quoted lines
> @@ -1132,7 +1126,6 @@ void odb_prepare(struct object_database *o, enum odb_prepare_flags flags)
> * the lifetime of the process.
> */
> if (flags & ODB_PREPARE_FLUSH_CACHES) {
> - o->loaded_alternates = 0;
> odb_prepare_alternates(o);Also nice to see this go away as I thought it was little bit awkward to unset it just to allow the us to reprepare the alternates.
-Justin