Re: [PATCH v5] submodule: port subcommand 'set-url' from shell to C
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 8, 2020, 16:17 UTC
- Message-ID
- <xmqqh7wqz9il.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200508063022.GA18557@generichostname>
Denton Liu <liu.denton@gmail.com> writes:
>> + if (argc != 2 || !path || !newurl) {
>> + usage_with_options(usage, options);
>> + return 1;It is embarrassing that nobody noticed that usage_with_options() is NORETURN; return 1 has no effect here.
Show 15 quoted lines
>> + }
>> +
>> + config_name = xstrfmt("submodule.%s.url", path);
>> +
>> + config_set_in_gitmodules_file_gently(config_name, newurl);
>> + sync_submodule(path, prefix, quiet ? OPT_QUIET : 0);
>> +
>> + free(config_name);
>> +
>> + return 0;
>> +}
>> +
>> #define SUPPORT_SUPER_PREFIX (1<<0)
>>
>> struct cmd_struct {