diff --git a/builtin-init-db.c b/builtin-init-db.c
index 8f2b7500dc339a275673c0a0c1b1b3e3e4f5301b..01f366ad0bf5860aaf9123ef5d5653c612871a9f 100644 (file)
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -124,8 +124,11 @@ static void copy_templates(const char *git_dir, int len, const char *template_di
int template_len;
DIR *dir;
- if (!template_dir)
- template_dir = DEFAULT_GIT_TEMPLATE_DIR;
+ if (!template_dir) {
+ template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
+ if (!template_dir)
+ template_dir = DEFAULT_GIT_TEMPLATE_DIR;
+ }
strcpy(template_path, template_dir);
template_len = strlen(template_path);
if (template_path[template_len-1] != '/') {
filemode ? "true" : "false");
}
+ /* Enable logAllRefUpdates if a working tree is attached */
+ if (!is_bare_git_dir(git_dir))
+ git_config_set("core.logallrefupdates", "true");
return reinit;
}