t/t0001-init.sh: add test for 'init with init.templatedir set'
Requires a small change to wrap-for-bin.sh in order to work. Signed-off-by: Steven Drake <sdrake@xnet.co.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b02a17f2b7
commit
a94d305bf8
@ -167,6 +167,25 @@ test_expect_success 'init with --template (blank)' '
|
|||||||
! test -f template-blank/.git/info/exclude
|
! test -f template-blank/.git/info/exclude
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'init with init.templatedir set' '
|
||||||
|
mkdir templatedir-source &&
|
||||||
|
echo Content >templatedir-source/file &&
|
||||||
|
(
|
||||||
|
HOME="`pwd`" &&
|
||||||
|
export HOME &&
|
||||||
|
test_config="${HOME}/.gitconfig" &&
|
||||||
|
git config -f "$test_config" init.templatedir "${HOME}/templatedir-source" &&
|
||||||
|
mkdir templatedir-set &&
|
||||||
|
cd templatedir-set &&
|
||||||
|
unset GIT_CONFIG_NOGLOBAL &&
|
||||||
|
unset GIT_TEMPLATE_DIR &&
|
||||||
|
NO_SET_GIT_TEMPLATE_DIR=t &&
|
||||||
|
export NO_SET_GIT_TEMPLATE_DIR &&
|
||||||
|
git init
|
||||||
|
) &&
|
||||||
|
test_cmp templatedir-source/file templatedir-set/.git/file
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'init --bare/--shared overrides system/global config' '
|
test_expect_success 'init --bare/--shared overrides system/global config' '
|
||||||
(
|
(
|
||||||
HOME="`pwd`" &&
|
HOME="`pwd`" &&
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
# @@BUILD_DIR@@ and @@PROG@@.
|
# @@BUILD_DIR@@ and @@PROG@@.
|
||||||
|
|
||||||
GIT_EXEC_PATH='@@BUILD_DIR@@'
|
GIT_EXEC_PATH='@@BUILD_DIR@@'
|
||||||
|
test -z "$NO_SET_GIT_TEMPLATE_DIR" &&
|
||||||
GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
|
GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
|
||||||
GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'
|
GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'
|
||||||
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
|
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
|
||||||
|
Loading…
Reference in New Issue
Block a user