summaryrefslogtreecommitdiff
path: root/t/t9401-git-cvsserver-crlf.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2010-09-06 18:39:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-06 21:30:53 (GMT)
commitfd4ec4f2bb980ce07bb28d5823a95610f251d00b (patch)
tree824a488c7708e4271f157f15c760947890a2e0bc /t/t9401-git-cvsserver-crlf.sh
parentaf24059fa299f1656692f5807eddd3b30b5f3cfb (diff)
downloadgit-fd4ec4f2bb980ce07bb28d5823a95610f251d00b.zip
git-fd4ec4f2bb980ce07bb28d5823a95610f251d00b.tar.gz
git-fd4ec4f2bb980ce07bb28d5823a95610f251d00b.tar.bz2
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/t9401-git-cvsserver-crlf.sh')
-rwxr-xr-xt/t9401-git-cvsserver-crlf.sh53
1 files changed, 27 insertions, 26 deletions
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index 925bd0f..1bbfd82 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -129,21 +129,22 @@ test_expect_success 'cvs co (use attributes)' '
'
test_expect_success 'adding files' '
- cd cvswork/subdir &&
+ (cd cvswork &&
+ (cd subdir &&
echo "more text" > src.c &&
GIT_CONFIG="$git_config" cvs -Q add src.c >cvs.log 2>&1 &&
marked_as . src.c "" &&
- echo "psuedo-binary" > temp.bin &&
- cd .. &&
+ echo "psuedo-binary" > temp.bin
+ ) &&
GIT_CONFIG="$git_config" cvs -Q add subdir/temp.bin >cvs.log 2>&1 &&
marked_as subdir temp.bin "-kb" &&
cd subdir &&
GIT_CONFIG="$git_config" cvs -Q ci -m "adding files" >cvs.log 2>&1 &&
marked_as . temp.bin "-kb" &&
marked_as . src.c ""
+ )
'
-cd "$WORKDIR"
test_expect_success 'updating' '
git pull gitcvs.git &&
echo 'hi' > subdir/newfile.bin &&
@@ -153,9 +154,9 @@ test_expect_success 'updating' '
git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin &&
git commit -q -m "Add and change some files" &&
git push gitcvs.git >/dev/null &&
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- cd .. &&
+ (cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q update
+ ) &&
marked_as cvswork textfile.c "" &&
marked_as cvswork binfile.bin -kb &&
marked_as cvswork .gitattributes "" &&
@@ -233,35 +234,35 @@ test_expect_success 'cvs co another copy (guess)' '
'
test_expect_success 'add text (guess)' '
- cd cvswork &&
+ (cd cvswork &&
echo "simpleText" > simpleText.c &&
- GIT_CONFIG="$git_config" cvs -Q add simpleText.c &&
- cd .. &&
+ GIT_CONFIG="$git_config" cvs -Q add simpleText.c
+ ) &&
marked_as cvswork simpleText.c ""
'
test_expect_success 'add bin (guess)' '
- cd cvswork &&
+ (cd cvswork &&
echo "simpleBin: NUL: Q <- there" | q_to_nul > simpleBin.bin &&
- GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin &&
- cd .. &&
+ GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin
+ ) &&
marked_as cvswork simpleBin.bin -kb
'
test_expect_success 'remove files (guess)' '
- cd cvswork &&
+ (cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q rm -f subdir/file.h &&
- cd subdir &&
- GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin &&
- cd ../.. &&
+ (cd subdir &&
+ GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin
+ )) &&
marked_as cvswork/subdir withCr.bin -kb &&
marked_as cvswork/subdir file.h ""
'
test_expect_success 'cvs ci (guess)' '
- cd cvswork &&
- GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1 &&
- cd .. &&
+ (cd cvswork &&
+ GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1
+ ) &&
marked_as cvswork textfile.c "" &&
marked_as cvswork binfile.bin -kb &&
marked_as cvswork .gitattributes "" &&
@@ -278,9 +279,9 @@ test_expect_success 'cvs ci (guess)' '
'
test_expect_success 'update subdir of other copy (guess)' '
- cd cvswork2/subdir &&
- GIT_CONFIG="$git_config" cvs -Q update &&
- cd ../.. &&
+ (cd cvswork2/subdir &&
+ GIT_CONFIG="$git_config" cvs -Q update
+ ) &&
marked_as cvswork2 textfile.c "" &&
marked_as cvswork2 binfile.bin -kb &&
marked_as cvswork2 .gitattributes "" &&
@@ -304,11 +305,11 @@ test_expect_success 'update/merge full other copy (guess)' '
git add multilineTxt.c &&
git commit -q -m "modify multiline file" >> "${WORKDIR}/marked.log" &&
git push gitcvs.git >/dev/null &&
- cd cvswork2 &&
+ (cd cvswork2 &&
sed "s/1/replaced_1/" < multilineTxt.c > ml.temp &&
mv ml.temp multilineTxt.c &&
- GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1 &&
- cd .. &&
+ GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1
+ ) &&
marked_as cvswork2 textfile.c "" &&
marked_as cvswork2 binfile.bin -kb &&
marked_as cvswork2 .gitattributes "" &&