tests: factor HOME=$(pwd) in test-lib.sh
The same pattern is used in many tests, and makes it easy for new ones to rely on $HOME being a trashable, clean, directory. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
0d314ce834
commit
e4c62e640d
@ -3,9 +3,6 @@
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
unset CVS_SERVER
|
unset CVS_SERVER
|
||||||
# for clean cvsps cache
|
|
||||||
HOME=$(pwd)
|
|
||||||
export HOME
|
|
||||||
|
|
||||||
if ! type cvs >/dev/null 2>&1
|
if ! type cvs >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
|
@ -171,8 +171,6 @@ test_expect_success 'init with init.templatedir set' '
|
|||||||
mkdir templatedir-source &&
|
mkdir templatedir-source &&
|
||||||
echo Content >templatedir-source/file &&
|
echo Content >templatedir-source/file &&
|
||||||
(
|
(
|
||||||
HOME="`pwd`" &&
|
|
||||||
export HOME &&
|
|
||||||
test_config="${HOME}/.gitconfig" &&
|
test_config="${HOME}/.gitconfig" &&
|
||||||
git config -f "$test_config" init.templatedir "${HOME}/templatedir-source" &&
|
git config -f "$test_config" init.templatedir "${HOME}/templatedir-source" &&
|
||||||
mkdir templatedir-set &&
|
mkdir templatedir-set &&
|
||||||
@ -188,8 +186,6 @@ test_expect_success 'init with init.templatedir set' '
|
|||||||
|
|
||||||
test_expect_success 'init --bare/--shared overrides system/global config' '
|
test_expect_success 'init --bare/--shared overrides system/global config' '
|
||||||
(
|
(
|
||||||
HOME="`pwd`" &&
|
|
||||||
export HOME &&
|
|
||||||
test_config="$HOME"/.gitconfig &&
|
test_config="$HOME"/.gitconfig &&
|
||||||
unset GIT_CONFIG_NOGLOBAL &&
|
unset GIT_CONFIG_NOGLOBAL &&
|
||||||
git config -f "$test_config" core.bare false &&
|
git config -f "$test_config" core.bare false &&
|
||||||
@ -205,8 +201,6 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
|
|||||||
|
|
||||||
test_expect_success 'init honors global core.sharedRepository' '
|
test_expect_success 'init honors global core.sharedRepository' '
|
||||||
(
|
(
|
||||||
HOME="`pwd`" &&
|
|
||||||
export HOME &&
|
|
||||||
test_config="$HOME"/.gitconfig &&
|
test_config="$HOME"/.gitconfig &&
|
||||||
unset GIT_CONFIG_NOGLOBAL &&
|
unset GIT_CONFIG_NOGLOBAL &&
|
||||||
git config -f "$test_config" core.sharedRepository 0666 &&
|
git config -f "$test_config" core.sharedRepository 0666 &&
|
||||||
|
@ -163,8 +163,6 @@ test_expect_success 'clone a void' '
|
|||||||
|
|
||||||
test_expect_success 'clone respects global branch.autosetuprebase' '
|
test_expect_success 'clone respects global branch.autosetuprebase' '
|
||||||
(
|
(
|
||||||
HOME=$(pwd) &&
|
|
||||||
export HOME &&
|
|
||||||
test_config="$HOME/.gitconfig" &&
|
test_config="$HOME/.gitconfig" &&
|
||||||
unset GIT_CONFIG_NOGLOBAL &&
|
unset GIT_CONFIG_NOGLOBAL &&
|
||||||
git config -f "$test_config" branch.autosetuprebase remote &&
|
git config -f "$test_config" branch.autosetuprebase remote &&
|
||||||
|
@ -95,8 +95,6 @@ test_expect_success 'fresh clone with svn.authors-file in config' '
|
|||||||
(
|
(
|
||||||
rm -r "$GIT_DIR" &&
|
rm -r "$GIT_DIR" &&
|
||||||
test x = x"$(git config svn.authorsfile)" &&
|
test x = x"$(git config svn.authorsfile)" &&
|
||||||
HOME="`pwd`" &&
|
|
||||||
export HOME &&
|
|
||||||
test_config="$HOME"/.gitconfig &&
|
test_config="$HOME"/.gitconfig &&
|
||||||
unset GIT_CONFIG_NOGLOBAL &&
|
unset GIT_CONFIG_NOGLOBAL &&
|
||||||
unset GIT_DIR &&
|
unset GIT_DIR &&
|
||||||
|
@ -865,6 +865,9 @@ test_create_repo "$test"
|
|||||||
# in subprocesses like git equals our $PWD (for pathname comparisons).
|
# in subprocesses like git equals our $PWD (for pathname comparisons).
|
||||||
cd -P "$test" || exit 1
|
cd -P "$test" || exit 1
|
||||||
|
|
||||||
|
HOME=$(pwd)
|
||||||
|
export HOME
|
||||||
|
|
||||||
this_test=${0##*/}
|
this_test=${0##*/}
|
||||||
this_test=${this_test%%-*}
|
this_test=${this_test%%-*}
|
||||||
for skp in $GIT_SKIP_TESTS
|
for skp in $GIT_SKIP_TESTS
|
||||||
|
Loading…
Reference in New Issue
Block a user