Re: Report of use of "local" per t0000-basic.sh
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 24, 2019, 04:24 UTC
- Message-ID
- <xmqqwobp2961.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20191123041616.GD6430@camp.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> I think it's fine that we restrict the use of local to within a > function. In fact, dash (Debian and Ubuntu's default /bin/sh) exits > unsuccessfully if you use local outside of a function.
All of the above sounds quite sensible.
> Is there some place in particular that you've found we're using it > outside of a function? I don't know about others, but I'm certainly > interested in fixing these. It looks like we do use it in a function in > t0000 itself, though.
Yup, we definitely should fix it if there is a use of "local" at the top-level outside a function that does not make sense. The one in the t0000 that tests if "local" behaves the way we expect it to looks OK to me.