tests/int/{root,list}.bats: ALT_ROOT fixups in teardown

1. Add "unset ALT_ROOT" since it should not be used after teardown is
   called.

2. Remove "rm -rf $ALT_ROOT". It is not needed, because ALT_ROOT is a
   subdirectory of ROOT, which is removed in teardown_bundle.

3. Checking for ALT_ROOT being non-empty is a leftover from the era when
   teardown() was called as the first step from setup(). Since commit
   41670e21f0 this is no longer the case, so the condition
   is no longer needed (plus, the `set -u` which is about to be added
   should catch any possible use of unset ALT_ROOT).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2022-02-28 18:33:43 -08:00
parent 7da77d802e
commit 99d5c0231f
2 changed files with 4 additions and 7 deletions
+2 -3
View File
@@ -9,9 +9,8 @@ function setup() {
}
function teardown() {
if [ -n "$ALT_ROOT" ]; then
ROOT="$ALT_ROOT" teardown_bundle
fi
ROOT="$ALT_ROOT" teardown_bundle
unset ALT_ROOT
teardown_bundle
}