]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4034: fix use of one-shot variable assignment with shell function
authorEric Sunshine <sunshine@sunshineco.com>
Sat, 27 Jul 2024 05:35:06 +0000 (01:35 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sat, 27 Jul 2024 05:49:40 +0000 (22:49 -0700)
The behavior of a one-shot environment variable assignment of the form
"VAR=val cmd" is unspecified according to POSIX when "cmd" is a shell
function. Indeed the behavior differs between shell implementations and
even different versions of the same shell, thus should be avoided.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4034-diff-words.sh

index 74586f3813c6f44955a5407e0d3382febd9e4e58..4dcd7e99250ed1d3a34fa5f9176128a6cce68e66 100755 (executable)
@@ -70,7 +70,7 @@ test_language_driver () {
                word_diff --color-words
        '
        test_expect_success "diff driver '$lang' in Islandic" '
-               LANG=is_IS.UTF-8 LANGUAGE=is LC_ALL="$is_IS_locale" \
+               test_env LANG=is_IS.UTF-8 LANGUAGE=is LC_ALL="$is_IS_locale" \
                word_diff --color-words
        '
 }