Skip to content

Commit

Permalink
builtin-branch.c: guard config parser from value=NULL
Browse files Browse the repository at this point in the history
color.branch.* configuration variables expect a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 11, 2008
1 parent a0ed3e6 commit 5768c98
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions builtin-branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5768c98

Please sign in to comment.