From 8da0b02d9911d483d34ad8994c879953eebd345c Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Fri, 3 Jun 2022 13:15:06 +0200 Subject: tests: don't assume a .git/info for .git/info/attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change those tests that assumed that a .git/info directory would be created for them when writing .git/info/attributes to explicitly create the directory by setting "TEST_CREATE_REPO_NO_TEMPLATE=1" before sourcing test-lib.sh, and using the "--template=" argument to "git clone". The change here in here in t7814-grep-recurse-submodules.sh would continue "succeeding" with only the "TEST_CREATE_REPO_NO_TEMPLATE=1" part of this change. That's because those tests use "test_expect_failure", so they'd "pass" without this change, as "test_expect_failure" by design isn't discerning about what failure conditions it'll accept. But as we're fixing these sorts of issues across the test suite let's fix this one too. This issue was spotted with a local merge with another topic of mine[1], which introduces a stricter alternative to "test_expect_failure". 1. https://lore.kernel.org/git/cover-0.7-00000000000-20220318T002951Z-avarab@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- t/t0028-working-tree-encoding.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 't/t0028-working-tree-encoding.sh') diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index 82905a2156..7140960e1a 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -5,6 +5,7 @@ test_description='working-tree-encoding conversion via gitattributes' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +TEST_CREATE_REPO_NO_TEMPLATE=1 . ./test-lib.sh . "$TEST_DIRECTORY/lib-encoding.sh" @@ -69,6 +70,7 @@ test_expect_success 'check $GIT_DIR/info/attributes support' ' test_when_finished "rm -f test.utf32.git" && test_when_finished "git reset --hard HEAD" && + mkdir .git/info && echo "*.utf32 text working-tree-encoding=utf-32" >.git/info/attributes && git add test.utf32 && -- cgit v1.2.3