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>
Junio C Hamano committed
Jun 9, 2014 at 13:36 UTC
f23b1d06e5a7a162a7cfc5281b10580e7e3d23d6
1 file changed
+18
-9
t/t3302-notes-index-expensive.sh
+18
-9
@@ -106,18 +106,27 @@ do_tests () {
106
pr=$1
107
count=$2
108
109
- test_expect_success $pr 'setup / mkdir' '
110
- mkdir $count &&
111
- cd $count
109
+ test_expect_success $pr "setup $count" '
110
+ mkdir "$count" &&
111
+ (
112
+ cd "$count" &&
113
+ create_repo "$count"
114
+ )
115
'
116
114
- test_expect_success $pr "setup $count" "create_repo $count"
115
-
116
- test_expect_success $pr 'notes work' "test_notes $count"
117
-
118
- test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' "time_notes 100"
117
+ test_expect_success $pr 'notes work' '
118
+ (
119
+ cd "$count" &&
120
+ test_notes "$count"
121
+ )
122
+ '
123
120
- test_expect_success $pr 'teardown / cd ..' 'cd ..'
124
+ test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' '
125
+ (
126
+ cd "$count" &&
127
+ time_notes 100
128
+ )
129
+ '
130
}
131
132
do_tests NOT_EXPENSIVE 10