From 5768c98ab8892ee0ca46e23ed46c4d94e0503e72 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 11 Feb 2008 10:45:50 -0800 Subject: [PATCH] builtin-branch.c: guard config parser from value=NULL color.branch.* configuration variables expect a string value. Signed-off-by: Junio C Hamano --- builtin-branch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin-branch.c b/builtin-branch.c index 089cae592..e414c8898 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -70,12 +70,15 @@ static int git_branch_config(const char *var, const char *value) } if (!prefixcmp(var, "color.branch.")) { int slot = parse_branch_color_slot(var, 13); + if (!value) + return config_error_nonbool(var); color_parse(value, var, branch_colors[slot]); return 0; } - if (!strcmp(var, "branch.autosetupmerge")) - branch_track = git_config_bool(var, value); - + if (!strcmp(var, "branch.autosetupmerge")) { + branch_track = git_config_bool(var, value); + return 0; + } return git_default_config(var, value); } -- 2.30.2