Skip to content

Commit

Permalink
setup.c: guard config parser from value=NULL
Browse files Browse the repository at this point in the history
core.worktree expects a string value

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 11, 2008
1 parent d2370cc commit 180483c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 180483c

Please sign in to comment.