{"thread":{"id":"64436","subject":"[PATCH] t7004: do not chdir around in the main process","startedAt":"2025-11-04T15:29:01Z","lastAt":"2025-11-04T15:29:01Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"530197","messageId":"xmqqecqdrf44.fsf@gitster.g","threadId":"64436","inReplyTo":null,"subject":"[PATCH] t7004: do not chdir around in the main process","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-11-04T15:28:59Z","receivedAt":"2025-11-04T15:29:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From 11f438cea119c52cc0c982f2b859defb37fd8c64 Mon Sep 17 00:00:00 2001\nMove down to no-contains subdirectory inside a subshell, just like\nthe previous step that created and used it does.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * I noticed this while writing the --sort=version:tag test and\n   failing to find the test vector files I was creating in the test.\n   It turns out that the files I expected was inside a subdirectory\n   because this test piece chdir'ed down and nobody came back up\n   from there.\n\n t/t7004-tag.sh | 38 ++++++++++++++++++++------------------\n 1 file changed, 20 insertions(+), 18 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex d1388cfdf4..ce2ff2a28a 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -2293,24 +2293,26 @@ test_expect_success '--contains combined with --no-contains' '\n # don't recurse down to tags for trees or blobs pointed to by *those*\n # commits.\n test_expect_success 'Does --[no-]contains stop at commits? Yes!' '\n-\tcd no-contains &&\n-\tblob=$(git rev-parse v0.3:v0.3.t) &&\n-\ttree=$(git rev-parse v0.3^{tree}) &&\n-\tgit tag tag-blob $blob &&\n-\tgit tag tag-tree $tree &&\n-\tgit tag --contains v0.3 >actual &&\n-\tcat >expected <<-\\EOF &&\n-\tv0.3\n-\tv0.4\n-\tv0.5\n-\tEOF\n-\ttest_cmp expected actual &&\n-\tgit tag --no-contains v0.3 >actual &&\n-\tcat >expected <<-\\EOF &&\n-\tv0.1\n-\tv0.2\n-\tEOF\n-\ttest_cmp expected actual\n+\t(\n+\t\tcd no-contains &&\n+\t\tblob=$(git rev-parse v0.3:v0.3.t) &&\n+\t\ttree=$(git rev-parse v0.3^{tree}) &&\n+\t\tgit tag tag-blob $blob &&\n+\t\tgit tag tag-tree $tree &&\n+\t\tgit tag --contains v0.3 >actual &&\n+\t\tcat >expected <<-\\EOF &&\n+\t\tv0.3\n+\t\tv0.4\n+\t\tv0.5\n+\t\tEOF\n+\t\ttest_cmp expected actual &&\n+\t\tgit tag --no-contains v0.3 >actual &&\n+\t\tcat >expected <<-\\EOF &&\n+\t\tv0.1\n+\t\tv0.2\n+\t\tEOF\n+\t\ttest_cmp expected actual\n+\t)\n '\n \n test_expect_success 'If tag is created then tag message file is unlinked' '\n-- \n2.52.0-rc0\n\n"}]}