Re: [PATCH] t4014: shell portability fix
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Jun 1, 2016, 00:09 UTC
- Message-ID
- <574E27A4.6040804@ramsayjones.plus.com>
- In-Reply-To
- <xmqqbn3l3kmc.fsf@gitster.mtv.corp.google.com>
On 31/05/16 23:53, Junio C Hamano wrote:
Show 23 quoted lines
> 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> > --- > t/t4014-format-patch.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh > index 8049cad..c3aa543 100755 > --- 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 VAR=VAL' non-portable? So, maybe:
(GIT_AUTHOR_NAME="éxötìc"; export GIT_AUTHOR_NAME; test_commit exotic) &&
> test_when_finished "git reset --hard HEAD^" && > git format-patch -1 --stdout --from >patch && > cat >expect <<-\EOF &&
ATB, Ramsay Jones