Re: [PATCH] t4014: shell portability fix
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 1, 2016, 00:09 UTC
- Message-ID
- <CAPig+cR989yU4+JNTFREaeXqY61nusUOhufeBGGVCi29tR1P5w@mail.gmail.com>
- In-Reply-To
- <20160531225628.GA4585@sigill.intra.peff.net>
On Tue, May 31, 2016 at 6:56 PM, Jeff King <peff@peff.net> wrote:
Show 16 quoted lines
> On Tue, May 31, 2016 at 03:53:15PM -0700, Junio C Hamano wrote: >> One-shot assignment to an environment variable, i.e. >> >> VAR=VAL cmd >> >> does not work as expected for "cmd" that is a shell function on >> certain shells. test_commit _is_ a helper function and cannot be >> driven that way portably. >> >> Signed-off-by: Junio C Hamano <gitster@pobox.com> >> --- >> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh >> @@ -1072,7 +1072,7 @@ test_expect_success '--from omits redundant in-body header' ' >> test_expect_success 'in-body headers trigger content encoding' ' >> - GIT_AUTHOR_NAME="éxötìc" test_commit exotic && >> + (export GIT_AUTHOR_NAME="éxötìc"; test_commit exotic) &&
Isn't "export FOO=val" unportable?
> Thanks. This one is my fault. There's another use of the same name > elsewhere, but it's to call "git commit" directly, so it's OK.
I was under the impression that the project was moving toward 'env' to deal[1] with this sort of issue.
[1]: 512477b (tests: use "env" to run commands with temporary env-var settings, 2014-03-18)