diff options
author | Jens Lehmann <Jens.Lehmann@web.de> | 2010-09-06 20:39:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-06 14:30:53 -0700 |
commit | fd4ec4f2bb980ce07bb28d5823a95610f251d00b (patch) | |
tree | 824a488c7708e4271f157f15c760947890a2e0bc /t/t9600-cvsimport.sh | |
parent | af24059fa299f1656692f5807eddd3b30b5f3cfb (diff) | |
download | git-fd4ec4f2bb980ce07bb28d5823a95610f251d00b.tar.gz |
Several tests: 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 <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9600-cvsimport.sh')
-rwxr-xr-x | t/t9600-cvsimport.sh | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 2eff9cd68c..6ef1c34082 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -17,7 +17,7 @@ test_expect_success 'setup a cvs module' ' mkdir "$CVSROOT/module" && $CVS co -d module-cvs module && - cd module-cvs && + (cd module-cvs && cat <<EOF >o_fortuna && O Fortuna velut luna @@ -41,8 +41,8 @@ add "O Fortuna" lyrics These public domain lyrics make an excellent sample text. EOF - $CVS commit -F message && - cd .. + $CVS commit -F message + ) ' test_expect_success 'import a trivial module' ' @@ -52,7 +52,7 @@ test_expect_success 'import a trivial module' ' ' -test_expect_success 'pack refs' 'cd module-git && git gc && cd ..' +test_expect_success 'pack refs' '(cd module-git && git gc)' test_expect_success 'initial import has correct .git/cvs-revisions' ' @@ -62,8 +62,7 @@ test_expect_success 'initial import has correct .git/cvs-revisions' ' ' test_expect_success 'update cvs module' ' - - cd module-cvs && + (cd module-cvs && cat <<EOF >o_fortuna && O Fortune, like the moon @@ -86,16 +85,16 @@ translate to English My Latin is terrible. EOF - $CVS commit -F message && - cd .. + $CVS commit -F message + ) ' test_expect_success 'update git module' ' - cd module-git && + (cd module-git && git cvsimport -a -R -z 0 module && - git merge origin && - cd .. && + git merge origin + ) && test_cmp module-cvs/o_fortuna module-git/o_fortuna ' @@ -110,21 +109,20 @@ test_expect_success 'update has correct .git/cvs-revisions' ' test_expect_success 'update cvs module' ' - cd module-cvs && + (cd module-cvs && echo 1 >tick && $CVS add tick && $CVS commit -m 1 - cd .. - + ) ' test_expect_success 'cvsimport.module config works' ' - cd module-git && + (cd module-git && git config cvsimport.module module && git cvsimport -a -R -z0 && - git merge origin && - cd .. && + git merge origin + ) && test_cmp module-cvs/tick module-git/tick ' @@ -141,12 +139,12 @@ test_expect_success 'second update has correct .git/cvs-revisions' ' test_expect_success 'import from a CVS working tree' ' $CVS co -d import-from-wt module && - cd import-from-wt && + (cd import-from-wt && git cvsimport -a -z0 && echo 1 >expect && git log -1 --pretty=format:%s%n >actual && - test_cmp actual expect && - cd .. + test_cmp actual expect + ) ' |