Subject: Re: [PATCH 1/6] t5326: demonstrate potential bitmap corruption

From: Junio C Hamano <[email-masked]>
Date: Mon, 22 Aug 2022 12:31:44 -0700

Taylor Blau <[email-masked]> writes:

>> > +	git init repo &&
>> > +	test_when_finished "rm -fr repo" &&
>>
>> nit: test_when_finished should be the first line of the test.
>
> The "rm-then-init-then-test_when_finished" is an (unfortunate) pattern
> extended throughout t5326, mostly that some tests don't clean up "repo"
> after deleting and recreating it.

I do not think it is so bad to be defensive to "prepare it cleanly
enough so that I would not be affected".  So "rm -fr repo && git
init repo" I would fully support.  "init && test_when_finished" is
totally indefensible.  It should be the other way around.

> But it's easy enough to just use a separate repository, and avoid
> removing it altogether. Thanks for the suggestion!

Those who run tests in a batch without "-i" would have more material
to study and find breakages if you did so.  I agree that is probably
something worth doing (unless in narrow corner cases where each test
repository consumes unusual amount of storage or somethinglike that).