X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-init-db.c;h=7fdd2fa9f9f7fb2801c6e1fc398f78b414a269e1;hb=refs%2Fheads%2Fpu;hp=6a24e9bcab4a7b364b69f9ccf2ae822c40873895;hpb=0a8f4f0020cb35095005852c0797f0b90e9ebb74;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index 6a24e9bc..7fdd2fa9 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -263,7 +263,9 @@ int cmd_init_db(int argc, const char **argv, char **envp) if (!strncmp(arg, "--template=", 11)) template_dir = arg+11; else if (!strcmp(arg, "--shared")) - shared_repository = 1; + shared_repository = PERM_GROUP; + else if (!strncmp(arg, "--shared=", 9)) + shared_repository = git_config_perm("arg", arg+9); else die(init_db_usage); } @@ -301,8 +303,15 @@ int cmd_init_db(int argc, const char **argv, char **envp) strcpy(path+len, "/info"); safe_create_dir(path, 1); - if (shared_repository) - git_config_set("core.sharedrepository", "true"); + if (shared_repository) { + char buf[10]; + /* We do not spell "group" and such, so that + * the configuration can be read by older version + * of git. + */ + sprintf(buf, "%d", shared_repository); + git_config_set("core.sharedrepository", buf); + } return 0; }