t6046/t9833: fix use of "VAR=VAL cmd" with a shell function
commit079b087c8eaf8119c4b159598e7b6965c1ca3fe9
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 13 Jul 2018 05:52:02 +0000 (13 01:52 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jul 2018 21:55:01 +0000 (16 14:55 -0700)
treeb8ee700325bd72dac778dc2ba2f843744def22bf
parentf44a7442f6abeea0059fae46ce482b0c49c27de1
t6046/t9833: fix use of "VAR=VAL cmd" with a shell function

Unlike "FOO=bar cmd" one-shot environment variable assignments
which exist only for the invocation of 'cmd', those assigned by
"FOO=bar shell_func" exist within the running shell and continue to
do so until the process exits (or are explicitly unset). It is
unlikely that this behavior was intended by the test author.

In these particular tests, the "FOO=bar shell_func" invocations are
already in subshells, so the assignments don't last too long, don't
appear to harm subsequent commands in the same subshells, and don't
affect other tests in the same scripts, however, the usage is
nevertheless misleading and poor practice, so fix the tests to assign
and export the environment variables in the usual fashion.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6046-merge-skip-unneeded-updates.sh
t/t9833-errors.sh