Skip to content

Commit 627f2d7

Browse files
charvi-077gitster
authored andcommitted
t7201: use 'git -C' to avoid subshell
Signed-off-by: Charvi Mendiratta <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c327762 commit 627f2d7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

t/t7201-co.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,7 @@ test_expect_success 'switch branches while in subdirectory' '
339339
git checkout master &&
340340
341341
mkdir subs &&
342-
(
343-
cd subs &&
344-
git checkout side
345-
) &&
342+
git -C subs checkout side &&
346343
! test -f subs/one &&
347344
rm -fr subs
348345
'
@@ -357,10 +354,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
357354
358355
git checkout master &&
359356
mkdir -p subs &&
360-
(
361-
cd subs &&
362-
git checkout side -- bero
363-
) &&
357+
git -C subs checkout side -- bero &&
364358
test -f subs/bero
365359
'
366360

0 commit comments

Comments
 (0)