Stefan Beller <[email protected]> writes:
> 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/[email protected]/
>
> 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.
> 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.
>
>> Signed-off-by: Brandon Williams <[email protected]>
>> ---
>> 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
>>