3 test_description='git-cvsimport basic tests'
9 # for clean cvsps cache
13 if ! type cvs >/dev/null 2>&1
15 say 'skipping cvsimport tests, cvs not found'
20 cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
21 case "$cvsps_version" in
25 say 'skipping cvsimport tests, cvsps not found'
30 say 'skipping cvsimport tests, unsupported cvsps version'
36 test_expect_success 'setup cvsroot' 'cvs init'
38 test_expect_success 'setup a cvs module' '
40 mkdir "$CVSROOT/module" &&
41 cvs co -d module-cvs module &&
43 cat <<EOF >o_fortuna &&
62 add "O Fortuna" lyrics
64 These public domain lyrics make an excellent sample text.
66 cvs commit -F message &&
70 test_expect_success 'import a trivial module' '
72 git cvsimport -a -z 0 -C module-git module &&
73 test_cmp module-cvs/o_fortuna module-git/o_fortuna
77 test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
79 test_expect_success 'update cvs module' '
82 cat <<EOF >o_fortuna &&
97 it melts them like ice.
102 My Latin is terrible.
104 cvs commit -F message &&
108 test_expect_success 'update git module' '
111 git cvsimport -a -z 0 module &&
114 test_cmp module-cvs/o_fortuna module-git/o_fortuna
118 test_expect_success 'update cvs module' '
128 test_expect_success 'cvsimport.module config works' '
131 git config cvsimport.module module &&
132 git cvsimport -a -z0 &&
135 test_cmp module-cvs/tick module-git/tick
139 test_expect_success 'import from a CVS working tree' '
141 cvs co -d import-from-wt module &&
143 git cvsimport -a -z0 &&
145 git log -1 --pretty=format:%s%n >actual &&
146 test_cmp actual expect &&