diff --git a/builtin-init-db.c b/builtin-init-db.c index 6c46af9228..79eaf8d6ed 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -367,7 +367,9 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) /* * Set up the default .git directory contents */ - git_dir = get_git_dir(); + git_dir = getenv(GIT_DIR_ENVIRONMENT); + if (!git_dir) + git_dir = DEFAULT_GIT_DIR_ENVIRONMENT; safe_create_dir(git_dir, 0); /* Check to see if the repository version is right.