Subject: Re: [PATCH 2/4] ll-merge.c: refactor `read_merge_config()` to use `git_config_string()`

From: Matthieu Moy <[email-masked]>
Date: Wed, 13 Aug 2014 13:32:37 +0200

Tanay Abhra <[email-masked]> writes:

> Signed-off-by: Tanay Abhra <[email-masked]>
> ---
>  ll-merge.c | 23 ++++++-----------------
>  1 file changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/ll-merge.c b/ll-merge.c
> index fb61ea6..8ea03e5 100644
> --- a/ll-merge.c
> +++ b/ll-merge.c
> @@ -225,11 +225,8 @@ static int read_merge_config(const char *var, const char *value, void *cb)
>  	const char *key, *name;
>  	int namelen;
>  
> -	if (!strcmp(var, "merge.default")) {
> -		if (value)
> -			default_ll_merge = xstrdup(value);
> -		return 0;
> -	}
> +	if (!strcmp(var, "merge.default"))
> +		return git_config_string(&default_ll_merge, var, value);

Previously, merge.default without value was a no-op. It's now an error.

I think it makes perfect sense, but should be documented in the log
message.

Also, I think you should explain briefly the reason for not using your
non-callback API here.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/