Re: [PATCH 02/15] submodule: don't use submodule_from_name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 26, 2017, 21:06 UTC
- Message-ID
- <xmqqwp6uq56s.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kY9Pdk5C8=k-AQpCPwo3q9Jzfg9A93UQxGyyf_OyrMS_Q@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 7 quoted lines
> Rereading the archives, there was quite some discussion on the design > of these patches, but these lines of code did not get any attention > > https://public-inbox.org/git/4CDB3063.5010801@web.de/ > > I cc'd Jens in the hope of him having a good memory why he > wrote the code that way. :)
Thanks for digging. I wouldn't be surprised if this were a fallback to help a broken entry in .gitmodules that lack .path variable, but we shouldn't be sweeping the problem under the rug like that.
I wonder if we should barf loudly if there shouldn't be a submodule at that path, i.e.
if (!submodule)
die("there is no submodule defined for path '%s'"...);though.
Show 7 quoted lines
> Note that this is the last caller of submodule_from_name being > removed, so I would expect removal of submodule_from_name from > the t/helper/test-submodule-config.c as well as > Documentation/technical/api-submodule-config.txt > in a later part of this series. (Well technically it could go outside > of the series, but in the mean time we'd document and test > dead code)
Good thinking. As this is "cleanup" series, I think it is within its scope to remove an API function that becomes unused.
Show 22 quoted lines
>
>> Signed-off-by: Brandon Williams <bmwill@google.com>
>> ---
>> submodule.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/submodule.c b/submodule.c
>> index 7e87e4698..fd391aea6 100644
>> --- a/submodule.c
>> +++ b/submodule.c
>> @@ -1177,8 +1177,6 @@ static int get_next_submodule(struct child_process *cp,
>> continue;
>>
>> submodule = submodule_from_path(&null_oid, ce->name);
>> - if (!submodule)
>> - submodule = submodule_from_name(&null_oid, ce->name);
>>
>> default_argv = "yes";
>> if (spf->command_line_option == RECURSE_SUBMODULES_DEFAULT) {
>> --
>> 2.14.0.rc0.400.g1c36432dff-goog
>>