From: Glen Choo Date: Mon, 14 Feb 2022 02:52:21 GMT Subject: Re: [PATCH 8/8] submodule: fix bug and remove add_submodule_odb() Message-ID: In-Reply-To: Junio C Hamano writes: > Jonathan Tan writes: > >> I would write the commit message like this: >> >> submodule: fix latent check_has_commit() bug >> >> check_has_commit() will attempt to clear a non-initialized struct >> repository if initialization fails. This bug is masked by its only >> caller, submodule_has_commits(), first calling add_submodule_odb(). >> The latter fails if the repo does not exist, making >> submodule_has_commits() exit early and not invoke check_has_commit() >> in a situation in which initialization would fail. >> >> Fix this bug, and because calling add_submodule_odb() is no longer >> necessary as of 13a2f620b2 (submodule: pass repo to >> check_has_commit(), 2021-10-08), remove that call too. >> >> This is the last caller of add_submodule_odb(), so remove that >> function. (Adding submodule ODBs as alternates is still present in the >> form of add_submodule_odb_by_path().) > > Looks more clearly explained. > > We still end up calling add_to_alternate_memory(), so I take the > "let's have this early" back. Ok, so I won't send this patch separately. Thanks Jonathan for making things clearer :)