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'
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'
28 say 'skipping cvsimport tests, unsupported cvsps version'
33 test_expect_success 'setup cvsroot' 'cvs init'
35 test_expect_success 'setup a cvs module' '
37 mkdir "$CVSROOT/module" &&
38 cvs co -d module-cvs module &&
40 cat <<EOF >o_fortuna &&
59 add "O Fortuna" lyrics
61 These public domain lyrics make an excellent sample text.
63 cvs commit -F message &&
67 test_expect_success 'import a trivial module' '
69 git cvsimport -a -z 0 -C module-git module &&
70 test_cmp module-cvs/o_fortuna module-git/o_fortuna
74 test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
76 test_expect_success 'update cvs module' '
79 cat <<EOF >o_fortuna &&
94 it melts them like ice.
101 cvs commit -F message &&
105 test_expect_success 'update git module' '
108 git cvsimport -a -z 0 module &&
111 test_cmp module-cvs/o_fortuna module-git/o_fortuna
115 test_expect_success 'update cvs module' '
125 test_expect_success 'cvsimport.module config works' '
128 git config cvsimport.module module &&
129 git cvsimport -a -z0 &&
132 test_cmp module-cvs/tick module-git/tick
136 test_expect_success 'import from a CVS working tree' '
138 cvs co -d import-from-wt module &&
140 git cvsimport -a -z0 &&
142 git log -1 --pretty=format:%s%n >actual &&
143 test_cmp actual expect &&