Skip to content

Commit

Permalink
t/t0001-init.sh: add test for 'init with init.templatedir set'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Drake authored and Junio C Hamano committed Feb 26, 2010
1 parent b02a17f commit a94d305
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions t/t0001-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,25 @@ test_expect_success 'init with --template (blank)' '
! 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' '
(
HOME="`pwd`" &&
Expand Down
3 changes: 2 additions & 1 deletion wrap-for-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# @@BUILD_DIR@@ and @@PROG@@.

GIT_EXEC_PATH='@@BUILD_DIR@@'
GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
test -z "$NO_SET_GIT_TEMPLATE_DIR" &&
GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH
Expand Down

0 comments on commit a94d305

Please sign in to comment.