X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=setup.c;h=4509598d577baba8b1d7e8782d8e6ff8e74f9556;hb=055b66158c984c4e902735ab2a1a188509423f43;hp=e96a316452197ed4b224f0c6839f036a01082bc2;hpb=9539a56e23d29655ed0388fe6ad148139f771265;p=git.git diff --git a/setup.c b/setup.c index e96a31645..4509598d5 100644 --- a/setup.c +++ b/setup.c @@ -140,7 +140,7 @@ const char **get_pathspec(const char *prefix, const char **pathspec) * Test if it looks like we're at a git directory. * We want to see: * - * - either a objects/ directory _or_ the proper + * - either an objects/ directory _or_ the proper * GIT_OBJECT_DIRECTORY environment variable * - a refs/ directory * - either a HEAD symlink or a HEAD file that is formatted as @@ -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); @@ -388,7 +390,6 @@ int check_repository_format(void) const char *setup_git_directory(void) { const char *retval = setup_git_directory_gently(NULL); - check_repository_format(); /* If the work tree is not the default one, recompute prefix */ if (inside_work_tree < 0) {