tempfile: release deactivated strbufs instead of resetting
[gitweb.git] / t / t9600-cvsimport.sh
index 559ce417954e1ef8276efc860ca63eb0bdcce284..804ce3850ff3f7838035fd316e26ee301b525ff0 100755 (executable)
@@ -3,6 +3,11 @@
 test_description='git cvsimport basic tests'
 . ./lib-cvs.sh
 
+if ! test_have_prereq NOT_ROOT; then
+       skip_all='When cvs is compiled with CVS_BADROOT commits as root fail'
+       test_done
+fi
+
 test_expect_success PERL 'setup cvsroot environment' '
        CVSROOT=$(pwd)/cvsroot &&
        export CVSROOT
@@ -14,7 +19,7 @@ test_expect_success PERL '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
@@ -38,8 +43,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 PERL 'import a trivial module' '
@@ -49,7 +54,7 @@ test_expect_success PERL 'import a trivial module' '
 
 '
 
-test_expect_success PERL 'pack refs' 'cd module-git && git gc && cd ..'
+test_expect_success PERL 'pack refs' '(cd module-git && git gc)'
 
 test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
 
@@ -59,8 +64,7 @@ test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
 '
 
 test_expect_success PERL 'update cvs module' '
-
-       cd module-cvs &&
+       (cd module-cvs &&
        cat <<EOF >o_fortuna &&
 O Fortune,
 like the moon
@@ -83,16 +87,17 @@ translate to English
 
 My Latin is terrible.
 EOF
-       $CVS commit -F message &&
-       cd ..
+       $CVS commit -F message
+       )
 '
 
 test_expect_success PERL 'update git module' '
 
-       cd module-git &&
-       git cvsimport -a -R -z 0 module &&
-       git merge origin &&
-       cd .. &&
+       (cd module-git &&
+       git config cvsimport.trackRevisions true &&
+       git cvsimport -a -z 0 module &&
+       git merge origin
+       ) &&
        test_cmp module-cvs/o_fortuna module-git/o_fortuna
 
 '
@@ -107,21 +112,21 @@ test_expect_success PERL 'update has correct .git/cvs-revisions' '
 
 test_expect_success PERL 'update cvs module' '
 
-       cd module-cvs &&
+       (cd module-cvs &&
                echo 1 >tick &&
                $CVS add tick &&
                $CVS commit -m 1
-       cd ..
-
+       )
 '
 
 test_expect_success PERL '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 config cvsimport.trackRevisions true &&
+               git cvsimport -a -z0 &&
+               git merge origin
+       ) &&
        test_cmp module-cvs/tick module-git/tick
 
 '
@@ -138,12 +143,13 @@ test_expect_success PERL 'second update has correct .git/cvs-revisions' '
 test_expect_success PERL 'import from a CVS working tree' '
 
        $CVS co -d import-from-wt module &&
-       cd import-from-wt &&
+       (cd import-from-wt &&
+               git config cvsimport.trackRevisions false &&
                git cvsimport -a -z0 &&
                echo 1 >expect &&
                git log -1 --pretty=format:%s%n >actual &&
-               test_cmp actual expect &&
-       cd ..
+               test_cmp actual expect
+       )
 
 '