]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tests: remove last uses of C_LOCALE_OUTPUT
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 11 Feb 2021 01:53:52 +0000 (02:53 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Feb 2021 07:48:27 +0000 (23:48 -0800)
Remove the last uses of the C_LOCALE_OUTPUT prerequisite as well as
the prerequisite itself. This is a follow-up to d162b25f956 (tests:
remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20), as well as
the preceding commit where we removed the simpler uses of
C_LOCALE_OUTPUT.

Here I'm slightly refactoring a test added in 21e5ad50fc5 (safecrlf:
Add mechanism to warn about irreversible crlf conversions,
2008-02-06), as well as getting rid of another "test_have_prereq
C_LOCALE_OUTPUT" use.

I'm not leaving the prerequisite itself in place for in-flight changes
as there currently are none that introduce new tests that rely on it,
and because C_LOCALE_OUTPUT is currently a noop on the master branch
we likely won't have any new submissions that use it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0020-crlf.sh
t/t9003-help-autocorrect.sh
t/test-lib.sh

index 375cf9439858d974b9db8f826062a9577d70af9d..f25ae8b5e1f34dd8e58bbe65ee171cbf5c8aa14b 100755 (executable)
@@ -87,10 +87,8 @@ test_expect_success 'safecrlf: print warning only once' '
        git commit -m "nowarn" &&
        for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >doublewarn &&
        git add doublewarn 2>err &&
-       if test_have_prereq C_LOCALE_OUTPUT
-       then
-               test $(grep "CRLF will be replaced by LF" err | wc -l) = 1
-       fi
+       grep "CRLF will be replaced by LF" err >err.warnings &&
+       test_line_count = 1 err.warnings
 '
 
 
index 03cd5c5423627fa7c5162fb84ad41cdb1960a645..f00deaf3815f3b49c42da4021335e011bbcb3c32 100755 (executable)
@@ -56,11 +56,8 @@ test_expect_success 'autocorrect can be declined altogether' '
        git config help.autocorrect never &&
 
        test_must_fail git lfg 2>actual &&
-       if test_have_prereq C_LOCALE_OUTPUT
-       then
-               grep "is not a git command" actual &&
-               test_line_count = 1 actual
-       fi
+       grep "is not a git command" actual &&
+       test_line_count = 1 actual
 '
 
 test_done
index 431adba0fb3f8eafbf28795c15b8a8c941b51f9e..6d188a8075d63c4080de6ff75ebb321e8d58e7c6 100644 (file)
@@ -1519,11 +1519,6 @@ test -n "$USE_LIBPCRE2" && test_set_prereq PCRE
 test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
 test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
 
-# Used to be used for GIT_TEST_GETTEXT_POISON=false. Only here as a
-# shim for other in-flight changes. Should not be used and will be
-# removed soon.
-test_set_prereq C_LOCALE_OUTPUT
-
 if test -z "$GIT_TEST_CHECK_CACHE_TREE"
 then
        GIT_TEST_CHECK_CACHE_TREE=true