From: Junio C Hamano Date: Mon, 2 May 2016 21:24:04 +0000 (-0700) Subject: Merge branch 'jk/check-repository-format' into maint X-Git-Tag: v2.8.3~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85916549980c709ae14f8a935a5a6266a4a80b26;p=thirdparty%2Fgit.git Merge branch 'jk/check-repository-format' into maint The repository set-up sequence has been streamlined (the biggest change is that there is no longer git_config_early()), so that we do not attempt to look into refs/* when we know we do not have a Git repository. * jk/check-repository-format: verify_repository_format: mark messages for translation setup: drop repository_format_version global setup: unify repository version callbacks init: use setup.c's repo version verification setup: refactor repo format reading and verification config: drop git_config_early check_repository_format_gently: stop using git_config_early lazily load core.sharedrepository wrap shared_repository global in get/set accessors setup: document check_repository_format() --- 85916549980c709ae14f8a935a5a6266a4a80b26 diff --cc setup.c index 3439ec6d81,09d37204f9..1563cd42df --- a/setup.c +++ b/setup.c @@@ -5,11 -5,7 +5,10 @@@ static int inside_git_dir = -1; static int inside_work_tree = -1; static int work_tree_config_is_bogus; - static struct string_list unknown_extensions = STRING_LIST_INIT_DUP; +static struct startup_info the_startup_info; +struct startup_info *startup_info = &the_startup_info; + /* * The input parameter must contain an absolute path, and it must already be * normalized. @@@ -965,30 -995,9 +997,10 @@@ int git_config_perm(const char *var, co return -(i & 0666); } - int check_repository_format_version(const char *var, const char *value, void *cb) - { - int ret = check_repo_format(var, value, cb); - if (ret) - return ret; - if (strcmp(var, "core.bare") == 0) { - is_bare_repository_cfg = git_config_bool(var, 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); - free(git_work_tree_cfg); - git_work_tree_cfg = xstrdup(value); - inside_work_tree = -1; - } - return 0; - } - - int check_repository_format(void) + void check_repository_format(void) { check_repository_format_gently(get_git_dir(), NULL); + startup_info->have_repository = 1; - return 0; } /*