setup.c: guard config parser from value=NULL

core.worktree expects a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2008-02-11 11:00:32 -08:00
parent d2370cc296
commit 180483c5c9

View File

@ -372,6 +372,8 @@ int check_repository_format_version(const char *var, const char *value)
if (is_bare_repository_cfg == 1) if (is_bare_repository_cfg == 1)
inside_work_tree = -1; inside_work_tree = -1;
} else if (strcmp(var, "core.worktree") == 0) { } else if (strcmp(var, "core.worktree") == 0) {
if (!value)
return config_error_nonbool(var);
if (git_work_tree_cfg) if (git_work_tree_cfg)
free(git_work_tree_cfg); free(git_work_tree_cfg);
git_work_tree_cfg = xstrdup(value); git_work_tree_cfg = xstrdup(value);