aboutsummaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-11 10:45:50 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-11 13:11:36 -0800
commit5768c98ab8892ee0ca46e23ed46c4d94e0503e72 (patch)
tree3f3ef501dddb4fc3341406cc0f61a235b5eaec15 /builtin-branch.c
parenta0ed3e6adea2ca69b7f4a76ac771e39cc9fa272e (diff)
downloadgit-5768c98ab8892ee0ca46e23ed46c4d94e0503e72.tar.gz
git-5768c98ab8892ee0ca46e23ed46c4d94e0503e72.tar.xz
builtin-branch.c: guard config parser from value=NULL
color.branch.* configuration variables expect a string value. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c9
1 files 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);
}