summaryrefslogtreecommitdiff
path: root/t/t2100-update-cache-badpath.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-04-23 17:15:09 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-04-24 23:45:51 -0700
commit06478dab4c9fb57dc6b7299eafd18df1bea9ca22 (patch)
tree8cda819742ddae03b720f43f217c220ff255440f /t/t2100-update-cache-badpath.sh
parenttest-lib.sh: do not barf under --debug at the end of the test (diff)
downloadtgif-06478dab4c9fb57dc6b7299eafd18df1bea9ca22.tar.xz
test-lib: retire $remove_trash variable
The convention "$remove_trash is set to the trash directory that is used during the test, so that it will be removed at the end, but under --debug option we set the varilable to empty string to preserve the directory" made sense back when it was introduced, as there was no $TRASH_DIRECTORY variable. These days, since no tests looks at the variable, it is obscure and even risks that by mistake the variable gets used for something else (e.g. remove_trash=yes) and cause us misbehave. Worse yet, remove_trash was not initialized to an empty string at the beginning, so a stray environment variable the user has could have affected the logic when "--debug" is in use. Rewrite the clean-up sequence in test_done helper to explicitly check the $debug condition and remove the trash directory using the $TRASH_DIRECTORY variable. Note that "go to the directory one level above the trash and then remove it" is kept and this is deliverate; test_at_end_hook_ will keep running from the expected location, and also some platforms may not like a directory that is serving as the $cwd of a still-active process removed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2100-update-cache-badpath.sh')
0 files changed, 0 insertions, 0 deletions