X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-init-db.c;h=6a24e9bcab4a7b364b69f9ccf2ae822c40873895;hb=ae448e3854d8b6e7e37aa88fa3917f5dd97f3210;hp=2a1384ccb0b5a54f94057f9eac58ed449aac2fc5;hpb=12bb2035e9e28900a0a2ce36c5f38687a22c5157;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index 2a1384cc..6a24e9bc 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -199,6 +199,21 @@ static void create_default_files(const char *git_dir, const char *template_path) git_config(git_default_config); /* + * We would have created the above under user's umask -- under + * shared-repository settings, we would need to fix them up. + */ + if (shared_repository) { + path[len] = 0; + adjust_shared_perm(path); + strcpy(path + len, "refs"); + adjust_shared_perm(path); + strcpy(path + len, "refs/heads"); + adjust_shared_perm(path); + strcpy(path + len, "refs/tags"); + adjust_shared_perm(path); + } + + /* * Create the default symlink from ".git/HEAD" to the "master" * branch, if it does not exist yet. */ @@ -287,7 +302,7 @@ int cmd_init_db(int argc, const char **argv, char **envp) safe_create_dir(path, 1); if (shared_repository) - git_config_set("core.sharedRepository", "true"); + git_config_set("core.sharedrepository", "true"); return 0; }