Skip to content

Commit f23b1d0

Browse files
committed
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 <[email protected]>
1 parent ac2803b commit f23b1d0

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

t/t3302-notes-index-expensive.sh

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,27 @@ do_tests () {
106106
pr=$1
107107
count=$2
108108

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+
)
112115
'
113116

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+
'
119123

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+
'
121130
}
122131

123132
do_tests NOT_EXPENSIVE 10

0 commit comments

Comments
 (0)