Skip to content

Commit 21f5762

Browse files
szedergitster
authored andcommitted
t9300-fast-import: store the PID in a variable instead of pidfile
The five tests running 'git fast-import' in the background in 't9300-fast-import.sh' store the PID of that background process in a pidfile, to be used to check whether that background process survived each test and then to kill it in test_when_finished commands. To achieve this all these five tests run three $(cat <pidfile>) command substitutions each. Store the PID of the background 'git fast-import' in a variable to avoid those extra processes. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent da72936 commit 21f5762

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t9300-fast-import.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,12 +3165,12 @@ background_import_then_checkpoint () {
31653165
rm V.output
31663166

31673167
git fast-import $options <&8 >&9 &
3168-
echo $! >V.pid
3168+
fi_pid=$!
31693169
# We don't mind if fast-import has already died by the time the test
31703170
# ends.
31713171
test_when_finished "
31723172
exec 8>&-; exec 9>&-;
3173-
kill $(cat V.pid) && wait $(cat V.pid)
3173+
kill $fi_pid && wait $fi_pid
31743174
true"
31753175

31763176
# Start in the background to ensure we adhere strictly to (blocking)
@@ -3202,7 +3202,7 @@ background_import_then_checkpoint () {
32023202
}
32033203

32043204
background_import_still_running () {
3205-
if ! kill -0 "$(cat V.pid)"
3205+
if ! kill -0 "$fi_pid"
32063206
then
32073207
echo >&2 "background fast-import terminated too early"
32083208
false

0 commit comments

Comments
 (0)