Skip to content

Commit 61ac8ba

Browse files
committed
t7004: do not chdir around in the main process
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>
1 parent bea37f1 commit 61ac8ba

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

t/t7004-tag.sh

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,24 +2293,26 @@ test_expect_success '--contains combined with --no-contains' '
22932293
# don't recurse down to tags for trees or blobs pointed to by *those*
22942294
# commits.
22952295
test_expect_success 'Does --[no-]contains stop at commits? Yes!' '
2296-
cd no-contains &&
2297-
blob=$(git rev-parse v0.3:v0.3.t) &&
2298-
tree=$(git rev-parse v0.3^{tree}) &&
2299-
git tag tag-blob $blob &&
2300-
git tag tag-tree $tree &&
2301-
git tag --contains v0.3 >actual &&
2302-
cat >expected <<-\EOF &&
2303-
v0.3
2304-
v0.4
2305-
v0.5
2306-
EOF
2307-
test_cmp expected actual &&
2308-
git tag --no-contains v0.3 >actual &&
2309-
cat >expected <<-\EOF &&
2310-
v0.1
2311-
v0.2
2312-
EOF
2313-
test_cmp expected actual
2296+
(
2297+
cd no-contains &&
2298+
blob=$(git rev-parse v0.3:v0.3.t) &&
2299+
tree=$(git rev-parse v0.3^{tree}) &&
2300+
git tag tag-blob $blob &&
2301+
git tag tag-tree $tree &&
2302+
git tag --contains v0.3 >actual &&
2303+
cat >expected <<-\EOF &&
2304+
v0.3
2305+
v0.4
2306+
v0.5
2307+
EOF
2308+
test_cmp expected actual &&
2309+
git tag --no-contains v0.3 >actual &&
2310+
cat >expected <<-\EOF &&
2311+
v0.1
2312+
v0.2
2313+
EOF
2314+
test_cmp expected actual
2315+
)
23142316
'
23152317

23162318
test_expect_success 'If tag is created then tag message file is unlinked' '

0 commit comments

Comments
 (0)