]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/check-repository-format' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 2 May 2016 21:24:04 +0000 (14:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 May 2016 21:24:04 +0000 (14:24 -0700)
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()

1  2 
builtin/init-db.c
cache.h
environment.c
path.c
setup.c

Simple merge
diff --cc cache.h
Simple merge
diff --cc environment.c
Simple merge
diff --cc path.c
Simple merge
diff --cc setup.c
index 3439ec6d815f823ed853251c9afa94d14d78556a,09d37204f9cf0de78945bb5983ccfff21bc22e60..1563cd42df2865d9f4390c9e68cdc666b45fcf96
+++ 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);
-       return 0;
 +      startup_info->have_repository = 1;
  }
  
  /*