summaryrefslogtreecommitdiff
path: root/builtin-init-db.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-12-19 09:18:09 +0100
committerJunio C Hamano <junkio@cox.net>2006-12-19 01:14:59 -0800
commit8683a45d66967b0969516a2b72cdbf136c2064a2 (patch)
treeff543e98be6e36f0960660d4543b5f036917eb58 /builtin-init-db.c
parent171e800b374c98dd703e906bd9955b2b0410cabe (diff)
downloadgit-8683a45d66967b0969516a2b72cdbf136c2064a2.tar.gz
Introduce GIT_TEMPLATE_DIR
Instead of passing --template explicitely to init-db and clone, you can just set the environment variable GIT_TEMPLATE_DIR. Also make use of it in the tests, to make sure that the templates are copied. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-init-db.c')
-rw-r--r--builtin-init-db.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 1d7d15e8d5..c8ed5c2a0b 100644
--- 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("GIT_TEMPLATE_DIR");
+ 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] != '/') {