Skip to content
Snippets Groups Projects
Commit f3858f8e authored by Johannes Sixt's avatar Johannes Sixt Committed by Junio C Hamano
Browse files

t0001: fix GIT_* environment variable check under --valgrind


When a test case is run without --valgrind, the wrap-for-bin.sh
helper script inserts the environment variable GIT_TEXTDOMAINDIR, but
when run with --valgrind, the variable is missing. A recently
introduced test case expects the presence of the variable, though, and
fails under --valgrind.

Rewrite the test case to strip conditially defined environment variables
from both expected and actual output.

Signed-off-by: default avatarJohannes Sixt <j6t@kdbg.org>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 8384c139
No related branches found
No related tags found
No related merge requests found
...@@ -88,19 +88,17 @@ test_expect_success 'plain nested in bare through aliased command' ' ...@@ -88,19 +88,17 @@ test_expect_success 'plain nested in bare through aliased command' '
' '
test_expect_success 'No extra GIT_* on alias scripts' ' test_expect_success 'No extra GIT_* on alias scripts' '
( write_script script <<-\EOF &&
env | sed -ne "/^GIT_/s/=.*//p" && env |
echo GIT_PREFIX && # setup.c sed -n \
echo GIT_TEXTDOMAINDIR # wrapper-for-bin.sh -e "/^GIT_PREFIX=/d" \
) | sort | uniq >expected && -e "/^GIT_TEXTDOMAINDIR=/d" \
cat <<-\EOF >script && -e "/^GIT_/s/=.*//p" |
#!/bin/sh sort
env | sed -ne "/^GIT_/s/=.*//p" | sort >actual
exit 0
EOF EOF
chmod 755 script && ./script >expected &&
git config alias.script \!./script && git config alias.script \!./script &&
( mkdir sub && cd sub && git script ) && ( mkdir sub && cd sub && git script >../actual ) &&
test_cmp expected actual test_cmp expected actual
' '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment