3 test_description
='git-cvsimport basic tests'
8 # for clean cvsps cache
12 if ! type cvs
>/dev
/null
2>&1
14 say
'skipping cvsimport tests, cvs not found'
19 cvsps_version
=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
20 case "$cvsps_version" in
24 say
'skipping cvsimport tests, cvsps not found'
29 say
'skipping cvsimport tests, cvsps too old'
35 test_expect_success
'setup cvsroot' 'cvs init'
37 test_expect_success
'setup a cvs module' '
39 mkdir $CVSROOT/module &&
40 cvs co -d module-cvs module &&
42 cat <<EOF >o_fortuna &&
61 add "O Fortuna" lyrics
63 These public domain lyrics make an excellent sample text.
65 cvs commit -F message &&
69 test_expect_success
'import a trivial module' '
71 git cvsimport -a -z 0 -C module-git module &&
72 git diff module-cvs/o_fortuna module-git/o_fortuna
76 test_expect_success
'pack refs' 'cd module-git && git gc && cd ..'
78 test_expect_success
'update cvs module' '
81 cat <<EOF >o_fortuna &&
96 it melts them like ice.
101 My Latin is terrible.
103 cvs commit -F message &&
107 test_expect_success
'update git module' '
110 git cvsimport -a -z 0 module &&
113 git diff module-cvs/o_fortuna module-git/o_fortuna
117 test_expect_success
'update cvs module' '
127 test_expect_success
'cvsimport.module config works' '
130 git config cvsimport.module module &&
131 git cvsimport -a -z0 &&
134 git diff module-cvs/tick module-git/tick
138 test_expect_success
'import from a CVS working tree' '
140 cvs co -d import-from-wt module &&
142 git cvsimport -a -z0 &&
144 git log -1 --pretty=format:%s%n >actual &&
145 git diff actual expect &&