aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/setup.c b/setup.c
index a02932b96..a6013e6dd 100644
--- a/setup.c
+++ b/setup.c
@@ -409,15 +409,10 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)
repo_config = sb.buf;
/*
- * git_config() can't be used here because it calls git_pathdup()
- * to get $GIT_CONFIG/config. That call will make setup_git_env()
- * set git_dir to ".git".
- *
- * We are in gitdir setup, no git dir has been found useable yet.
- * Use a gentler version of git_config() to check if this repo
- * is a good one.
+ * Ignore return value; for historical reasons, we must treat a missing
+ * config file as a noop (git-init relies on this).
*/
- git_config_early(fn, NULL, repo_config);
+ git_config_from_file(fn, repo_config, NULL);
if (GIT_REPO_VERSION_READ < repository_format_version) {
if (!nongit_ok)
die ("Expected git repo version <= %d, found %d",