diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-04-25 12:17:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-04-25 12:17:45 -0700 |
commit | 36c79d2bf893b9957688a6c8c13cc0bf0589e596 (patch) | |
tree | 39c9815e82d5fffdb537ea9bfd6cf71359dec845 /builtin-init-db.c | |
parent | 049a226fa14fb25c03d2146c2f8f184cfea5e5bf (diff) | |
parent | 06cbe8550324e0fd2290839bf3b9a92aa53b70ab (diff) | |
download | git-36c79d2bf893b9957688a6c8c13cc0bf0589e596.tar.gz git-36c79d2bf893b9957688a6c8c13cc0bf0589e596.tar.xz |
Merge branch 'ho/shared'
* ho/shared:
Make core.sharedRepository more generic
Diffstat (limited to 'builtin-init-db.c')
-rw-r--r-- | builtin-init-db.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/builtin-init-db.c b/builtin-init-db.c index 2854868b4..a76f5d347 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -400,9 +400,16 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) char buf[10]; /* We do not spell "group" and such, so that * the configuration can be read by older version - * of git. + * of git. Note, we use octal numbers for new share modes, + * and compatibility values for PERM_GROUP and + * PERM_EVERYBODY. */ - sprintf(buf, "%d", shared_repository); + if (shared_repository == PERM_GROUP) + sprintf(buf, "%d", OLD_PERM_GROUP); + else if (shared_repository == PERM_EVERYBODY) + sprintf(buf, "%d", OLD_PERM_EVERYBODY); + else + sprintf(buf, "0%o", shared_repository); git_config_set("core.sharedrepository", buf); git_config_set("receive.denyNonFastforwards", "true"); } |