summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 171e800)
raw | patch | inline | side by side (parent: 171e800)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 19 Dec 2006 08:18:09 +0000 (09:18 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 19 Dec 2006 09:14:59 +0000 (01:14 -0800) |
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>
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>
builtin-init-db.c | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 1d7d15e8d53a7a2817ceff6f5c5e056747688c9e..c8ed5c2a0b8837c443be790eb6b4b520c6d6373b 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("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] != '/') {
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ac7be769b4d4f04908a64592a5c3ad8c43c27e60..f0f9cd6be01681c90d1914eaa8a40144e2280adf 100755 (executable)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
# t/ subdirectory and are run in trash subdirectory.
PATH=$(pwd)/..:$PATH
GIT_EXEC_PATH=$(pwd)/..
+GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
HOME=$(pwd)/trash
-export PATH GIT_EXEC_PATH HOME
+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR HOME
GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
export GITPERLLIB