3 test_description='git-cvsimport basic tests'
6 if ! ( type cvs && type cvsps ) >/dev/null 2>&1
8 test_expect_success 'skipping cvsimport tests, cvs/cvsps not found' ''
13 CVSROOT=$(pwd)/cvsroot
15 # for clean cvsps cache
19 test_expect_success 'setup cvsroot' 'cvs init'
21 test_expect_success 'setup a cvs module' '
23 mkdir $CVSROOT/module &&
24 cvs co -d module-cvs module &&
26 cat <<EOF >o_fortuna &&
45 add "O Fortuna" lyrics
47 These public domain lyrics make an excellent sample text.
49 cvs commit -F message &&
53 test_expect_success 'import a trivial module' '
55 git cvsimport -a -z 0 -C module-git module &&
56 git diff module-cvs/o_fortuna module-git/o_fortuna
60 test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
62 test_expect_success 'update cvs module' '
65 cat <<EOF >o_fortuna &&
80 it melts them like ice.
87 cvs commit -F message &&
91 test_expect_success 'update git module' '
94 git cvsimport -a -z 0 module &&
97 git diff module-cvs/o_fortuna module-git/o_fortuna
101 test_expect_success 'update cvs module' '
111 test_expect_success 'cvsimport.module config works' '
114 git config cvsimport.module module &&
115 git cvsimport -a -z0 &&
118 git diff module-cvs/tick module-git/tick
122 test_expect_success 'import from a CVS working tree' '
124 cvs co -d import-from-wt module &&
126 git cvsimport -a -z0 &&
128 git log -1 --pretty=format:%s%n >actual &&
129 git diff actual expect &&