Re: [PATCH v3 5/7] object-file: only register submodule ODB if needed
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Oct 8, 2021, 20:22 UTC
- Message-ID
- <20211008202235.1326279-1-jonathantanmy@google.com>
- In-Reply-To
- <YV89ukrCS3NmIKsl@google.com>
Show 16 quoted lines
> > @@ -1614,7 +1614,8 @@ static int do_oid_object_info_extended(struct repository *r, > > break; > > } > > > > - if (register_all_submodule_odb_as_alternates()) > > + if (r == the_repository && > > + register_all_submodule_odb_as_alternates()) > > /* We added some alternates; retry */ > > continue; > > > > -- > > 2.33.0.685.g46640cef36-goog > > > > It looks like this is just a small bugfix, but can you expand on the > implications here? What happens if r != the_repository?
The purpose of the quoted block (before and after the check added in this patch) is so that reading submodule objects by reading them as if they were in the_repository works, and it follows that this is only necessary if we pass the_repository (because we are reading them as if they were in the_repository). I'll add a comment explaining this.