Code

builtin-branch.c: guard config parser from value=NULL
authorJunio C Hamano <gitster@pobox.com>
Mon, 11 Feb 2008 18:45:50 +0000 (10:45 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Feb 2008 21:11:36 +0000 (13:11 -0800)
color.branch.* configuration variables expect a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-branch.c

index 089cae59299659b20359b7249e57ddc3a43ded06..e414c8898317736d632064d6c0545d7d128c6bc8 100644 (file)
@@ -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);
 }