summaryrefslogtreecommitdiff
path: root/t/t9300-fast-import.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2019-12-06 19:03:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-06 19:45:57 (GMT)
commit21f57620b2e73d20f5c98006af756e0162eaee3b (patch)
tree381b888b0df39e126f989dc6bd845f1e78845503 /t/t9300-fast-import.sh
parentda72936f544fec5a335e66432610e4cef4430991 (diff)
downloadgit-21f57620b2e73d20f5c98006af756e0162eaee3b.zip
git-21f57620b2e73d20f5c98006af756e0162eaee3b.tar.gz
git-21f57620b2e73d20f5c98006af756e0162eaee3b.tar.bz2
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 <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9300-fast-import.sh')
-rwxr-xr-xt/t9300-fast-import.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index e707fb8..6820ebb 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -3165,12 +3165,12 @@ background_import_then_checkpoint () {
rm V.output
git fast-import $options <&8 >&9 &
- echo $! >V.pid
+ fi_pid=$!
# We don't mind if fast-import has already died by the time the test
# ends.
test_when_finished "
exec 8>&-; exec 9>&-;
- kill $(cat V.pid) && wait $(cat V.pid)
+ kill $fi_pid && wait $fi_pid
true"
# Start in the background to ensure we adhere strictly to (blocking)
@@ -3202,7 +3202,7 @@ background_import_then_checkpoint () {
}
background_import_still_running () {
- if ! kill -0 "$(cat V.pid)"
+ if ! kill -0 "$fi_pid"
then
echo >&2 "background fast-import terminated too early"
false