builtin-commit.c: guard config parser from value=NULL

commit.template configuration expects a string value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Junio C Hamano 2008-02-11 10:46:39 -08:00
parent 5768c98ab8
commit d865eb2a0d
1 changed files with 2 additions and 0 deletions

View File

@ -743,6 +743,8 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
int git_commit_config(const char *k, const char *v)
{
if (!strcmp(k, "commit.template")) {
if (!v)
return config_error_nonbool(v);
template_file = xstrdup(v);
return 0;
}