X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-init-db.c;h=e23b8438c741651f48bbf529f89d0336cc718fed;hb=f4022fa33f1b0a63029d1bc3748f01f720151218;hp=3968c9911ff23717a4505ba9a02af6e27bf0b4a0;hpb=0166592495e21b075fa48225ff21568269bf51d4;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index 3968c9911..e23b8438c 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -144,7 +144,7 @@ static void copy_templates(const char *template_dir) strcpy(template_path + template_len, "config"); repository_format_version = 0; git_config_from_file(check_repository_format_version, - template_path); + template_path, NULL); template_path[template_len] = 0; if (repository_format_version && @@ -198,7 +198,7 @@ static int create_default_files(const char *template_path) */ copy_templates(template_path); - git_config(git_default_config); + git_config(git_default_config, NULL); /* * We would have created the above under user's umask -- under @@ -364,7 +364,7 @@ static int guess_repository_type(const char *git_dir) } static const char init_db_usage[] = -"git-init [-q | --quiet] [--template=] [--shared]"; +"git-init [-q | --quiet] [--bare] [--template=] [--shared[=]]"; /* * If you want to, you can share the DB area with any number of branches. @@ -383,7 +383,12 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) const char *arg = argv[1]; if (!prefixcmp(arg, "--template=")) template_dir = arg+11; - else if (!strcmp(arg, "--shared")) + else if (!strcmp(arg, "--bare")) { + static char git_dir[PATH_MAX+1]; + is_bare_repository_cfg = 1; + setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, + sizeof(git_dir)), 0); + } else if (!strcmp(arg, "--shared")) shared_repository = PERM_GROUP; else if (!prefixcmp(arg, "--shared=")) shared_repository = git_config_perm("arg", arg+9);