Skip to content

Commit

Permalink
t5801: "VAR=VAL shell_func args" is forbidden
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Apr 25, 2013
1 parent 664059f commit 1afe6e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/t5801-remote-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ test_expect_success 'pushing without refspecs' '
(cd local2 &&
echo content >>file &&
git commit -a -m ten &&
GIT_REMOTE_TESTGIT_REFSPEC="" test_must_fail git push 2>../error) &&
GIT_REMOTE_TESTGIT_REFSPEC="" &&
export GIT_REMOTE_TESTGIT_REFSPEC &&
test_must_fail git push 2>../error) &&
grep "remote-helper doesn.t support push; refspec needed" error
'

Expand Down

0 comments on commit 1afe6e4

Please sign in to comment.