summaryrefslogtreecommitdiff
path: root/t/t3703-add-magic-pathspec.sh
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2021-05-10 16:19:00 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-05-11 12:45:17 +0900
commitedc23840b0baad017d02037f0a833eaa600ee21d (patch)
tree4138285592f8e76a1656e250d42bfab60e4e56a0 /t/t3703-add-magic-pathspec.sh
parentThe eighth batch (diff)
downloadtgif-edc23840b0baad017d02037f0a833eaa600ee21d.tar.xz
test-lib: bring $remove_trash out of retirement
There's no point in creating a repository or directory only to decide right afterwards that we're skipping all the tests. We can save ourselves the redundant "git init" or "mkdir" and "rm -rf" in this case. We carry around the "$remove_trash" variable because if the directory is unexpectedly gone at test_done time we'll still want to hit the "trash directory already removed" error, but not if we never created the trash directory. See df4c0d1a792 (test-lib: abort when can't remove trash directory, 2017-04-20) for the addition of that error. So let's partially revert 06478dab4c (test-lib: retire $remove_trash variable, 2017-04-23) and move the decision about whether to skip all tests earlier. Let's also fix a bug that was with us since abc5d372ec (Enable parallel tests, 2008-08-08): we would leak $remove_trash from the environment. We don't want this to error out, so let's reset it to the empty string first: remove_trash=t GIT_SKIP_TESTS=t0001 ./t0001-init.sh I tested this with --debug, see 4d0912a206 (test-lib.sh: do not barf under --debug at the end of the test, 2017-04-24) for a bug we don't want to re-introduce. While I'm at it, let's move the HOME assignment to just before test_create_repo, it could be lower, but it seems better to set it before calling anything in test-lib-functions.sh Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3703-add-magic-pathspec.sh')
0 files changed, 0 insertions, 0 deletions