]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9600-cvsimport.sh
Test contents of entire cvsimported "master" tree contents
[thirdparty/git.git] / t / t9600-cvsimport.sh
CommitLineData
795c7c0b
JK
1#!/bin/sh
2
f964732c 3test_description='git cvsimport basic tests'
535bb893 4. ./lib-cvs.sh
795c7c0b 5
40ae8872
FL
6CVSROOT=$(pwd)/cvsroot
7export CVSROOT
dcbcb707 8
161261b1 9test_expect_success 'setup cvsroot' '$CVS init'
795c7c0b
JK
10
11test_expect_success 'setup a cvs module' '
12
f69e836f 13 mkdir "$CVSROOT/module" &&
161261b1 14 $CVS co -d module-cvs module &&
795c7c0b
JK
15 cd module-cvs &&
16 cat <<EOF >o_fortuna &&
17O Fortuna
18velut luna
19statu variabilis,
20
21semper crescis
22aut decrescis;
23vita detestabilis
24
25nunc obdurat
26et tunc curat
27ludo mentis aciem,
28
29egestatem,
30potestatem
31dissolvit ut glaciem.
32EOF
161261b1 33 $CVS add o_fortuna &&
795c7c0b
JK
34 cat <<EOF >message &&
35add "O Fortuna" lyrics
36
37These public domain lyrics make an excellent sample text.
38EOF
161261b1 39 $CVS commit -F message &&
795c7c0b
JK
40 cd ..
41'
42
43test_expect_success 'import a trivial module' '
44
45 git cvsimport -a -z 0 -C module-git module &&
3af82863 46 test_cmp module-cvs/o_fortuna module-git/o_fortuna
795c7c0b
JK
47
48'
49
9da0dabc
JK
50test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
51
795c7c0b
JK
52test_expect_success 'update cvs module' '
53
54 cd module-cvs &&
55 cat <<EOF >o_fortuna &&
56O Fortune,
57like the moon
58you are changeable,
59
60ever waxing
61and waning;
62hateful life
63
64first oppresses
65and then soothes
66as fancy takes it;
67
68poverty
69and power
70it melts them like ice.
71EOF
72 cat <<EOF >message &&
73translate to English
74
75My Latin is terrible.
76EOF
161261b1 77 $CVS commit -F message &&
795c7c0b
JK
78 cd ..
79'
80
81test_expect_success 'update git module' '
82
83 cd module-git &&
84 git cvsimport -a -z 0 module &&
85 git merge origin &&
86 cd .. &&
3af82863 87 test_cmp module-cvs/o_fortuna module-git/o_fortuna
795c7c0b
JK
88
89'
90
67d23242
JK
91test_expect_success 'update cvs module' '
92
93 cd module-cvs &&
94 echo 1 >tick &&
161261b1
MH
95 $CVS add tick &&
96 $CVS commit -m 1
67d23242
JK
97 cd ..
98
99'
100
101test_expect_success 'cvsimport.module config works' '
102
103 cd module-git &&
104 git config cvsimport.module module &&
105 git cvsimport -a -z0 &&
106 git merge origin &&
107 cd .. &&
3af82863 108 test_cmp module-cvs/tick module-git/tick
67d23242
JK
109
110'
111
4e596e98
JK
112test_expect_success 'import from a CVS working tree' '
113
161261b1 114 $CVS co -d import-from-wt module &&
4e596e98
JK
115 cd import-from-wt &&
116 git cvsimport -a -z0 &&
117 echo 1 >expect &&
118 git log -1 --pretty=format:%s%n >actual &&
3af82863 119 test_cmp actual expect &&
4e596e98
JK
120 cd ..
121
122'
123
cefa318d
MH
124test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'
125
795c7c0b 126test_done