summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-11 19:00:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-11 21:11:37 (GMT)
commit180483c5c94a37c9fe304dded99d3db56d2d2b38 (patch)
tree00d8321d27b5342192aad04dd799f5d1df632a0e
parentd2370cc2960d3b0a090c57dfea99209c59b515f7 (diff)
downloadgit-180483c5c94a37c9fe304dded99d3db56d2d2b38.zip
git-180483c5c94a37c9fe304dded99d3db56d2d2b38.tar.gz
git-180483c5c94a37c9fe304dded99d3db56d2d2b38.tar.bz2
setup.c: guard config parser from value=NULL
core.worktree expects a string value Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--setup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index adede16..4509598 100644
--- a/setup.c
+++ b/setup.c
@@ -372,6 +372,8 @@ int check_repository_format_version(const char *var, const char *value)
if (is_bare_repository_cfg == 1)
inside_work_tree = -1;
} else if (strcmp(var, "core.worktree") == 0) {
+ if (!value)
+ return config_error_nonbool(var);
if (git_work_tree_cfg)
free(git_work_tree_cfg);
git_work_tree_cfg = xstrdup(value);