summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2016-03-03 07:55:17 +0100
committerJunio C Hamano <gitster@pobox.com>2016-03-03 08:55:13 -0800
commitf3858f8edcb91054cdc0b6f086ec34109582f67f (patch)
tree63ccfa75387a0f927dcdc24a8dae9b6b731a329b
parent8384c139cb9409fb3cf5ef70afff263917581258 (diff)
downloadgit-nd/clear-gitenv-upon-use-of-alias.tar.gz
t0001: fix GIT_* environment variable check under --valgrindnd/clear-gitenv-upon-use-of-alias
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: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t0001-init.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index f7c00f6b12..b4f7c6b363 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -88,19 +88,17 @@ test_expect_success 'plain nested in bare through aliased command' '
'
test_expect_success 'No extra GIT_* on alias scripts' '
- (
- env | sed -ne "/^GIT_/s/=.*//p" &&
- echo GIT_PREFIX && # setup.c
- echo GIT_TEXTDOMAINDIR # wrapper-for-bin.sh
- ) | sort | uniq >expected &&
- cat <<-\EOF >script &&
- #!/bin/sh
- env | sed -ne "/^GIT_/s/=.*//p" | sort >actual
- exit 0
+ write_script script <<-\EOF &&
+ env |
+ sed -n \
+ -e "/^GIT_PREFIX=/d" \
+ -e "/^GIT_TEXTDOMAINDIR=/d" \
+ -e "/^GIT_/s/=.*//p" |
+ sort
EOF
- chmod 755 script &&
+ ./script >expected &&
git config alias.script \!./script &&
- ( mkdir sub && cd sub && git script ) &&
+ ( mkdir sub && cd sub && git script >../actual ) &&
test_cmp expected actual
'