diff options
author | Junio C Hamano <junkio@cox.net> | 2006-06-18 20:19:09 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-18 20:19:09 -0700 |
commit | d9faecac641ab31c7bfe5008f5a6dca119b79bc7 (patch) | |
tree | e132b0d810e00c6ea2bb4ea5c8a4597ff4cb0e2a /builtin-init-db.c | |
parent | 72afd3eea6758a5ef181eaa3eef0b21639177494 (diff) | |
parent | 94df2506edd76a886a1044376f8c99349b2f226e (diff) | |
download | git-d9faecac641ab31c7bfe5008f5a6dca119b79bc7.tar.gz |
Merge branch 'jc/shared'
* jc/shared:
shared repository: optionally allow reading to "others".
Diffstat (limited to 'builtin-init-db.c')
-rw-r--r-- | builtin-init-db.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/builtin-init-db.c b/builtin-init-db.c index 6a24e9bcab..7fdd2fa9f9 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; } |