]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7004: do not chdir around in the main process
authorJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2025 15:28:59 +0000 (07:28 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2025 15:32:25 +0000 (07:32 -0800)
Move down to no-contains subdirectory inside a subshell, just like
the previous step that created and used it does.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7004-tag.sh

index d1388cfdf45b02eae2bd6ee4b4a4dc315867fe70..ce2ff2a28abaa37e7fe95f422c4faa64980339b6 100755 (executable)
@@ -2293,24 +2293,26 @@ test_expect_success '--contains combined with --no-contains' '
 # don't recurse down to tags for trees or blobs pointed to by *those*
 # commits.
 test_expect_success 'Does --[no-]contains stop at commits? Yes!' '
-       cd no-contains &&
-       blob=$(git rev-parse v0.3:v0.3.t) &&
-       tree=$(git rev-parse v0.3^{tree}) &&
-       git tag tag-blob $blob &&
-       git tag tag-tree $tree &&
-       git tag --contains v0.3 >actual &&
-       cat >expected <<-\EOF &&
-       v0.3
-       v0.4
-       v0.5
-       EOF
-       test_cmp expected actual &&
-       git tag --no-contains v0.3 >actual &&
-       cat >expected <<-\EOF &&
-       v0.1
-       v0.2
-       EOF
-       test_cmp expected actual
+       (
+               cd no-contains &&
+               blob=$(git rev-parse v0.3:v0.3.t) &&
+               tree=$(git rev-parse v0.3^{tree}) &&
+               git tag tag-blob $blob &&
+               git tag tag-tree $tree &&
+               git tag --contains v0.3 >actual &&
+               cat >expected <<-\EOF &&
+               v0.3
+               v0.4
+               v0.5
+               EOF
+               test_cmp expected actual &&
+               git tag --no-contains v0.3 >actual &&
+               cat >expected <<-\EOF &&
+               v0.1
+               v0.2
+               EOF
+               test_cmp expected actual
+       )
 '
 
 test_expect_success 'If tag is created then tag message file is unlinked' '