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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tanay Abhra <tanayabh@xxxxxxxxx> writes:

> Signed-off-by: Tanay Abhra <tanayabh@xxxxxxxxx>
> ---
>  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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]