X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=setup.c;h=3b111ea7cf5f68ecca085f5a56421ea190e1771a;hb=4f80b27d48fee1c588810f3341ffe5d14558cea2;hp=b8fd476395db782bf942a548b87242b3a9f990f4;hpb=ca1c9913f8ac0ccaf976d44822076e1bba5bcd94;p=git.git diff --git a/setup.c b/setup.c index b8fd47639..3b111ea7c 100644 --- a/setup.c +++ b/setup.c @@ -292,15 +292,16 @@ void setup_work_tree(void) work_tree = get_git_work_tree(); git_dir = get_git_dir(); if (!is_absolute_path(git_dir)) - set_git_dir(make_absolute_path(git_dir)); + git_dir = make_absolute_path(git_dir); if (!work_tree || chdir(work_tree)) die("This operation must be run in a work tree"); + set_git_dir(make_relative_path(git_dir, work_tree)); initialized = 1; } static int check_repository_format_gently(int *nongit_ok) { - git_config(check_repository_format_version); + git_config(check_repository_format_version, NULL); if (GIT_REPO_VERSION < repository_format_version) { if (!nongit_ok) die ("Expected git repo version <= %d, found %d", @@ -524,7 +525,7 @@ int git_config_perm(const char *var, const char *value) return i & 0666; } -int check_repository_format_version(const char *var, const char *value) +int check_repository_format_version(const char *var, const char *value, void *cb) { if (strcmp(var, "core.repositoryformatversion") == 0) repository_format_version = git_config_int(var, value);