Re: [PATCH 8/8] submodule: fix bug and remove add_submodule_odb()
- From
Glen Choo <chooglen@google.com>
- Date
- Feb 14, 2022, 02:52 UTC
- Message-ID
- <kl6lzgmuw462.fsf@chooglen-macbookpro.roam.corp.google.com>
- In-Reply-To
- <xmqqy22hcodn.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 25 quoted lines
> Jonathan Tan <jonathantanmy@google.com> 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 :)