diff --git a/builtin-init-db.c b/builtin-init-db.c
index 6a24e9bcab4a7b364b69f9ccf2ae822c40873895..52473edf569e4d318a74548acefaf4023f37c87c 100644 (file)
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
* On the other hand, it might just make lookup slower and messier. You
* be the judge. The default case is to have one DB per managed directory.
*/
* On the other hand, it might just make lookup slower and messier. You
* be the judge. The default case is to have one DB per managed directory.
*/
-int cmd_init_db(int argc, const char **argv, char **envp)
+int cmd_init_db(int argc, const char **argv, const char *prefix)
{
const char *git_dir;
const char *sha1_dir;
{
const char *git_dir;
const char *sha1_dir;
if (!strncmp(arg, "--template=", 11))
template_dir = arg+11;
else if (!strcmp(arg, "--shared"))
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);
}
else
die(init_db_usage);
}
strcpy(path+len, "/info");
safe_create_dir(path, 1);
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;
}
return 0;
}