Re: [PATCH] t5582: remove spurious 'cd "$D"' line
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 30, 2021, 19:51 UTC
- Message-ID
- <xmqqwno23e3l.fsf@gitster.g>
- In-Reply-To
- <YS0qbgQhRP6XI7aj@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> Just throwing "set -u" at the top of test-lib.sh shows many issues:
>
> - we don't initialize some known variables, like say, verbose_only. It
> might be reasonable to have a big list of:
>
> verbose_only=
> verbose=
>
> etc. That would probably be an improvement, though a slight
> maintenance burden.
>
> : ${GIT_TEST_CMP:=}
>
> near the top of the script to pre-declare all such variables.These two are sensible clean-up, I would think, whether we aim to achieve "set -u" cleanness. The original issue triggered this thread was about $D that can be confused by a leaked environment variable, but these "known variables" that are not assigned to in the early part of the tests are inviting similar troubles.
Thanks.