Re: [PATCH v3 04/10] submodule--helper clone: check for configured submodules using helper
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2017, 20:25 UTC
- Message-ID
- <xmqq60jbip23.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kZ20Jy_A8SPJte7U0iZZB97P0Sn_PqAMfwp40sAj6Y=RA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 7 quoted lines
>> I am wondering what was meant by the comment "We must not fall back to..." >> that is being removed---is that because sub->url can come from .gitmodules >> that is in-tree, not from .git/config? > > Yes. We want to check for the submodule being "initialized", i.e. > having a url in .git/config. (and the struct submodule reads in both .git/config > and .gitmodules and overlays them with a given precedence order)
OK, thanks.
I agree that the current code happens to be OK but the arrangement looks rather brittle to me. It seems the code liberally call gitmodules_config() without making sure it is early enough to do so (iow, git_config() for submodule-related stuff has not been done and will be done before the values read there are the ones that are used).