3 test_description='git cvsimport basic tests'
6 if ! test_have_prereq PERL; then
7 say 'skipping git cvsimport tests, perl not available'
11 CVSROOT=$(pwd)/cvsroot
14 test_expect_success 'setup cvsroot' '$CVS init'
16 test_expect_success 'setup a cvs module' '
18 mkdir "$CVSROOT/module" &&
19 $CVS co -d module-cvs module &&
21 cat <<EOF >o_fortuna &&
40 add "O Fortuna" lyrics
42 These public domain lyrics make an excellent sample text.
44 $CVS commit -F message &&
48 test_expect_success 'import a trivial module' '
50 git cvsimport -a -z 0 -C module-git module &&
51 test_cmp module-cvs/o_fortuna module-git/o_fortuna
55 test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
57 test_expect_success 'update cvs module' '
60 cat <<EOF >o_fortuna &&
75 it melts them like ice.
82 $CVS commit -F message &&
86 test_expect_success 'update git module' '
89 git cvsimport -a -z 0 module &&
92 test_cmp module-cvs/o_fortuna module-git/o_fortuna
96 test_expect_success 'update cvs module' '
106 test_expect_success 'cvsimport.module config works' '
109 git config cvsimport.module module &&
110 git cvsimport -a -z0 &&
113 test_cmp module-cvs/tick module-git/tick
117 test_expect_success 'import from a CVS working tree' '
119 $CVS co -d import-from-wt module &&
121 git cvsimport -a -z0 &&
123 git log -1 --pretty=format:%s%n >actual &&
124 test_cmp actual expect &&
129 test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'