diff options
| author | Shawn O. Pearce <spearce@spearce.org> | 2008-10-08 08:05:43 -0700 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-08 08:05:43 -0700 |
| commit | c4f6a48969b33e7fec8fce592e38a60849782d2a (patch) | |
| tree | b80cf97c8a44782c982a7aa1181f2da3f602aaf3 /builtin-init-db.c | |
| parent | 19d4b416f429ac2d3f4c225aaf1af8761bcb03dd (diff) | |
| parent | fb7424363643d6049faf3bda399e5e602782b5b7 (diff) | |
| download | git-c4f6a48969b33e7fec8fce592e38a60849782d2a.tar.gz | |
Merge branch 'maint'
* maint:
Do not use errno when pread() returns 0
git init: --bare/--shared overrides system/global config
git-push.txt: Describe --repo option in more detail
git rm: refresh index before up-to-date check
Fix a few typos in relnotes
Diffstat (limited to 'builtin-init-db.c')
| -rw-r--r-- | builtin-init-db.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/builtin-init-db.c b/builtin-init-db.c index 8140c1299a..d30c3fe2ca 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -17,6 +17,9 @@ #define TEST_FILEMODE 1 #endif +static int init_is_bare_repository = 0; +static int init_shared_repository = -1; + static void safe_create_dir(const char *dir, int share) { if (mkdir(dir, 0777) < 0) { @@ -191,6 +194,9 @@ static int create_default_files(const char *template_path) copy_templates(template_path); git_config(git_default_config, NULL); + is_bare_repository_cfg = init_is_bare_repository; + if (init_shared_repository != -1) + shared_repository = init_shared_repository; /* * We would have created the above under user's umask -- under @@ -277,6 +283,8 @@ int init_db(const char *template_dir, unsigned int flags) safe_create_dir(get_git_dir(), 0); + init_is_bare_repository = is_bare_repository(); + /* Check to see if the repository version is right. * Note that a newly created repository does not have * config file, so this will not fail. What we are catching @@ -381,9 +389,9 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0); } else if (!strcmp(arg, "--shared")) - shared_repository = PERM_GROUP; + init_shared_repository = PERM_GROUP; else if (!prefixcmp(arg, "--shared=")) - shared_repository = git_config_perm("arg", arg+9); + init_shared_repository = git_config_perm("arg", arg+9); else if (!strcmp(arg, "-q") || !strcmp(arg, "--quiet")) flags |= INIT_DB_QUIET; else |
