Re: [PATCH 2/4] ll-merge.c: refactor `read_merge_config()` to use `git_config_string()`
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 13, 2014, 11:32 UTC
- Message-ID
- <vpqfvh0vd4a.fsf@anie.imag.fr>
- In-Reply-To
- <1407918122-29973-2-git-send-email-tanayabh@gmail.com>
Tanay Abhra <tanayabh@gmail.com> writes:
Show 20 quoted lines
> Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
> ---
> 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/