Thread (47 messages) flat view 47 messages, 5 authors, 19d ago

Re: [PATCH 3/4] odb: drop `loaded_alternates` field

From: Justin Tobler <hidden>
Date: 2026-08-11 22:22:31

On 26/08/10 03:33PM, Patrick Steinhardt wrote:
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 <redacted>
---
[snip]
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help