t3701: stop using `env` in force_color()
commit4d9e7c153df9b411d782759bbc8def1c8458f4a6
authorDenton Liu <liu.denton@gmail.com>
Tue, 7 Jul 2020 06:04:34 +0000 (7 02:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Jul 2020 20:07:26 +0000 (7 13:07 -0700)
treead4115c702dad32602545865d45d4cb8d4dc3700
parent4a0fcf9f760c9774be77f51e1e88a7499b53d2e2
t3701: stop using `env` in force_color()

In a future patch, we plan on making the test_must_fail()-family of
functions accept only git commands. Even though force_color() wraps an
invocation of `env git`, test_must_fail() will not be able to figure
this out since it will assume that force_color() is just some random
function which is disallowed.

Instead of using `env` in force_color() (which does not support shell
functions), export the environment variables in a subshell. Write the
invocation as `force_color test_must_fail git ...` since shell functions
are now supported.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3701-add-interactive.sh