{"thread":{"id":"55923","subject":"[PATCH] pre-commit hook tests: don't leave \"actual\" nonexisting on failure","startedAt":"2021-06-14T10:41:14Z","lastAt":"2021-06-14T10:41:14Z","messageCount":1,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"427315","messageId":"patch-1.1-d08a435b8ef-20210614T103654Z-avarab@gmail.com","threadId":"55923","inReplyTo":null,"subject":"[PATCH] pre-commit hook tests: don't leave \"actual\" nonexisting on failure","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T10:37:35Z","receivedAt":"2021-06-14T10:41:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Start by creating an \"actual\" file in a core.hooksPath test that has\nthe hook echoing to the \"actual\" file.\n\nWe later test_cmp that file to see what hooks were run. If we fail to\nrun our hook(s) we'll have an empty list of hooks for the test_cmp\ninstead of a nonexisting file. For the logic of this test that makes more sense.\n\nSee 867ad08a261 (hooks: allow customizing where the hook directory is,\n2016-05-04) for the commit that added these tests.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nA trivial test improvement split off from v2 of\nhttps://lore.kernel.org/git/cover-00.30-00000000000-20210614T101920Z-avarab@gmail.com/\n\n t/t1350-config-hooks-path.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/t1350-config-hooks-path.sh b/t/t1350-config-hooks-path.sh\nindex f1f9aee9f5d..fa9647a7c0b 100755\n--- a/t/t1350-config-hooks-path.sh\n+++ b/t/t1350-config-hooks-path.sh\n@@ -5,6 +5,7 @@ test_description='Test the core.hooksPath configuration variable'\n . ./test-lib.sh\n \n test_expect_success 'set up a pre-commit hook in core.hooksPath' '\n+\t>actual &&\n \tmkdir -p .git/custom-hooks .git/hooks &&\n \twrite_script .git/custom-hooks/pre-commit <<-\\EOF &&\n \techo CUSTOM >>actual\n-- \n2.32.0.rc3.434.gd8aed1f08a7\n\n"}]}