]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0017-env-helper.sh
tests: make GIT_TEST_GETTEXT_POISON a boolean
[thirdparty/git.git] / t / t0017-env-helper.sh
index 709bbbd275491fbd45baac480a6a61e70a2e759f..c1ecf6aeac672056613c558fd27daaf6337ac1a6 100755 (executable)
@@ -80,4 +80,20 @@ test_expect_success 'env--helper --type=ulong' '
        test_must_be_empty actual.err
 '
 
+test_expect_success 'env--helper reads config thanks to trace2' '
+       mkdir home &&
+       git config -f home/.gitconfig include.path cycle &&
+       git config -f home/cycle include.path .gitconfig &&
+
+       test_must_fail \
+               env HOME="$(pwd)/home" GIT_TEST_GETTEXT_POISON=false \
+               git config -l 2>err &&
+       grep "exceeded maximum include depth" err &&
+
+       test_must_fail \
+               env HOME="$(pwd)/home" GIT_TEST_GETTEXT_POISON=true \
+               git -C cycle env--helper --type=bool --default=0 --exit-code GIT_TEST_GETTEXT_POISON 2>err &&
+       grep "# GETTEXT POISON #" err
+'
+
 test_done