Taylor Blau [off-list ref] writes:
Most importantly, it removes many instances in t5318 that change
directories outside of a sub-shell, altering the current working
directory of subsequent tests. This makes it difficult to run a subset
of tests, or otherwise include `cd "$TRASH_DIRECTORY"` at the top of
each test.
Thanks for tackling this aspect of this test script. It does look
problematic and unnecessarily makes it harder to debug the test
itself.