t5801: "VAR=VAL shell_func args" is forbidden

It is not a portable expectation that a single-shot environment variable assignment works when calling a shell function, not a command. Set and export the variable before calling "test_must_fail git push" instead. This change would not hurt because this is the last command in the subprocess and the environment will not seep through to later tests without using a single-shot assignment. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Apr 25, 2013 at 10:18 UTC 1afe6e404453586a1095ce0f3f7e899e62ab237f
1 file changed +3 -1
t/t5801-remote-helpers.sh
+3 -1
@@ -118,7 +118,9 @@ test_expect_success 'pushing without refspecs' '
118 (cd local2 &&
119 echo content >>file &&
120 git commit -a -m ten &&
121 - GIT_REMOTE_TESTGIT_REFSPEC="" test_must_fail git push 2>../error) &&
121 + GIT_REMOTE_TESTGIT_REFSPEC="" &&
122 + export GIT_REMOTE_TESTGIT_REFSPEC &&
123 + test_must_fail git push 2>../error) &&
124 grep "remote-helper doesn.t support push; refspec needed" error
125 '
126