Re: [PATCH 1/6] t5326: demonstrate potential bitmap corruption
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 22, 2022, 19:31 UTC
- Message-ID
- <xmqqbksccbxb.fsf@gitster.g>
- In-Reply-To
- <YwPDkW8KemC5Hs/C@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 8 quoted lines
>> > + 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).