object-file: only register submodule ODB if needed
commiteef71904ff68e90f2db37aa9e25fe82c3fccf2a0
authorJonathan Tan <jonathantanmy@google.com>
Fri, 8 Oct 2021 21:08:18 +0000 (8 14:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Oct 2021 22:06:06 +0000 (8 15:06 -0700)
treeeece2d56814c5a970e2b7d7aa7389724c3e4677f
parent155b517d5c8701f3b8bef78fe59d8fe33adbee96
object-file: only register submodule ODB if needed

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c