Re: [PATCH v3 5/7] object-file: only register submodule ODB if needed
- From
Josh Steadmon <steadmon@google.com>
- Date
- Oct 7, 2021, 18:34 UTC
- Message-ID
- <YV89ukrCS3NmIKsl@google.com>
- In-Reply-To
- <0200f1880b7d92dcee0ef1d011bdc654bc3b4f0d.1632956589.git.jonathantanmy@google.com>
On 2021.09.29 16:06, Jonathan Tan wrote:
Show 29 quoted lines
> In a35e03dee0 ("submodule: lazily add submodule ODBs as alternates",
> 2021-09-08), Git was taught to add all known submodule ODBs as
> alternates when attempting to read an object that doesn't exist, as a
> fallback for when a submodule object is read as if it were in
> the_repository. However, this behavior wasn't restricted to happen only
> when reading from the_repository. Fix this.
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
> object-file.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/object-file.c b/object-file.c
> index be4f94ecf3..2b988b7c36 100644
> --- a/object-file.c
> +++ b/object-file.c
> @@ -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?