test-lib: abort when can't remove trash directory
commitdf4c0d1a7927e17e7944ec24fa94468eee979f6e
authorSZEDER Gábor <szeder.dev@gmail.com>
Thu, 20 Apr 2017 16:52:30 +0000 (20 18:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 23 Apr 2017 23:55:46 +0000 (23 16:55 -0700)
tree022d8a7efabbe21b055d0294764429b0fe93ceff
parentef09036cf34c2e5704c753a4ffb3c947a89402af
test-lib: abort when can't remove trash directory

We had two similar bugs in the tests sporadically triggering error
messages during the removal of the trash directory, see commits
bb05510e5 (t5510: run auto-gc in the foreground, 2016-05-01) and
ef09036cf (t6500: wait for detached auto gc at the end of the test
script, 2017-04-13).  The test script succeeded nonetheless, because
these errors are ignored during housekeeping in 'test_done'.

However, such an error is a sign that something is fishy in the test
script.  Print an error message and abort the test script when the
trash directory can't be removed successfully or is already removed,
because that's unexpected and we would prefer somebody notice and
figure out why.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh