diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2019-06-20 23:09:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-20 15:06:10 -0700 |
commit | 8423083540e08298d3aa3b48e76639658cd11470 (patch) | |
tree | 302f67a6ed6ec630efadc04b2cd90d6d646bfd5a /t | |
parent | The second batch (diff) | |
download | tgif-8423083540e08298d3aa3b48e76639658cd11470.tar.xz |
config tests: simplify include cycle test
Simplify an overly verbose test added in 9b25a0b52e ("config: add
include directive", 2012-02-06). The "expect" file was never used, and
by using .gitconfig it's not as intuitive to reproduce this manually
with "-d" as some other tests, since HOME needs to be set in the
environment.
Also remove the use of test_i18ngrep added in a769bfc74f ("config.c:
mark more strings for translation", 2018-07-21) in favor of overriding
the GIT_TEST_GETTEXT_POISON value.
Using the i18n test wrappers hasn't been needed since my
6cdccfce1e ("i18n: make GETTEXT_POISON a runtime option", 2018-11-08).
As a follow-up change to the yet-to-be-added t0017-env-helper.sh will
show, doing it this way can hide a regression when combined with
trace2's early config reading. That early config reading was added in
bce9db6de9 ("trace2: use system/global config for default trace2
settings", 2019-04-15).
So let's remove the testing for that potential regression here, I'll
instead add it explicitly to t0017-env-helper.sh in a follow-up
change.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t1305-config-include.sh | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh index 579a86b7f8..6b388ba2d0 100755 --- a/t/t1305-config-include.sh +++ b/t/t1305-config-include.sh @@ -310,20 +310,13 @@ test_expect_success SYMLINKS 'conditional include, gitdir matching symlink, icas ' test_expect_success 'include cycles are detected' ' - cat >.gitconfig <<-\EOF && - [test]value = gitconfig - [include]path = cycle - EOF - cat >cycle <<-\EOF && - [test]value = cycle - [include]path = .gitconfig - EOF - cat >expect <<-\EOF && - gitconfig - cycle - EOF - test_must_fail git config --get-all test.value 2>stderr && - test_i18ngrep "exceeded maximum include depth" stderr + git init --bare cycle && + git -C cycle config include.path cycle && + git config -f cycle/cycle include.path config && + test_must_fail \ + env GIT_TEST_GETTEXT_POISON= \ + git -C cycle config --get-all test.value 2>stderr && + grep "exceeded maximum include depth" stderr ' test_done |