Re: [PATCHv2 2/8] submodule config: keep update strategy around
- From
- Eric Sunshine <ericsunshine@gmail.com>
- Date
- Oct 30, 2015, 01:14 UTC
- Message-ID
- <CAPig+cRTa35B5aHcopaWOtCLxN6BhGJKTcVeDUf0hrZE_nfCKQ@mail.gmail.com>
- In-Reply-To
- <1446074504-6014-3-git-send-email-sbeller@google.com>
On Wed, Oct 28, 2015 at 7:21 PM, Stefan Beller <sbeller@google.com> wrote:
Show 17 quoted lines
> We need the submodule update strategies in a later patch.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> diff --git a/submodule-config.c b/submodule-config.c
> index afe0ea8..8b8c7d1 100644
> --- a/submodule-config.c
> +++ b/submodule-config.c
> @@ -311,6 +312,16 @@ static int parse_config(const char *var, const char *value, void *data)
> free((void *) submodule->url);
> submodule->url = xstrdup(value);
> }
> + } else if (!strcmp(item.buf, "update")) {
> + if (!value)
> + ret = config_error_nonbool(var);
> + else if (!me->overwrite && submodule->update != NULL)Although "foo != NULL" is unusual in this code-base, it is used elsewhere in this file, including just outside the context seen above. Okay.
> + warn_multiple_config(me->commit_sha1, submodule->name,
> + "update");
> + else {
> + free((void *)submodule->update);Minor: Every other 'free((void *) foo)' in this file has a space after "(void *)", one of which can be seen in the context just above.
Show 5 quoted lines
> + submodule->update = xstrdup(value); > + } > } > > strbuf_release(&name);