t3302: do not chdir around in the primary test process

These days^Wyears we strive to do stuff in subdirectories inside
subshells to avoid mistakes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2014-06-09 13:36:54 -07:00
parent ac2803b962
commit f23b1d06e5

View File

@ -106,18 +106,27 @@ do_tests () {
pr=$1 pr=$1
count=$2 count=$2
test_expect_success $pr 'setup / mkdir' ' test_expect_success $pr "setup $count" '
mkdir $count && mkdir "$count" &&
cd $count (
cd "$count" &&
create_repo "$count"
)
' '
test_expect_success $pr "setup $count" "create_repo $count" test_expect_success $pr 'notes work' '
(
cd "$count" &&
test_notes "$count"
)
'
test_expect_success $pr 'notes work' "test_notes $count" test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' '
(
test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' "time_notes 100" cd "$count" &&
time_notes 100
test_expect_success $pr 'teardown / cd ..' 'cd ..' )
'
} }
do_tests NOT_EXPENSIVE 10 do_tests NOT_EXPENSIVE 10