X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-init-db.c;h=6a24e9bcab4a7b364b69f9ccf2ae822c40873895;hb=HEAD;hp=88b39a47eba51f709895d9460d16eacf6cee152f;hpb=e9b9368168399bf165a0172bb00a67216479c82b;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index 88b39a47..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. */