Skip to content

Commit c2e0940

Browse files
jlehmanngitster
authored andcommitted
t3404 & t7508: cd inside subshell instead of around
Fixed all places where it was a straightforward change from cd'ing into a directory and back via "cd .." to a cd inside a subshell. Found these places with "git grep -w "cd \.\.". Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4682693 commit c2e0940

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ test_expect_success 'rebase -i with the exec command' '
101101

102102
test_expect_success 'rebase -i with the exec command runs from tree root' '
103103
git checkout master &&
104-
mkdir subdir && cd subdir &&
104+
mkdir subdir && (cd subdir &&
105105
FAKE_LINES="1 exec_>touch-subdir" \
106-
git rebase -i HEAD^ &&
107-
cd .. &&
106+
git rebase -i HEAD^
107+
) &&
108108
test_path_is_file touch-subdir &&
109109
rm -fr subdir
110110
'

t/t7508-status.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository'
808808
(exit $status)
809809
'
810810

811-
(cd sm && echo > bar && git add bar && git commit -q -m 'Add bar' && cd .. && git add sm)
811+
(cd sm && echo > bar && git add bar && git commit -q -m 'Add bar') && git add sm
812812
new_head=$(cd sm && git rev-parse --short=7 --verify HEAD)
813813
touch .gitmodules
814814

0 commit comments

Comments
 (0)