3 # Copyright (c) 2006, Junio C Hamano
6 test_description
='fmt-merge-msg test'
12 GIT_COMMITTER_DATE
="$datestamp +0200"
13 GIT_AUTHOR_DATE
="$datestamp +0200"
14 datestamp
=`expr "$datestamp" + 1`
15 export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
18 test_expect_success setup
'
22 git commit -m "Initial" &&
28 git commit -a -m "Second" &&
30 git checkout -b left &&
32 echo $datestamp >one &&
34 git commit -a -m "Common #1" &&
36 echo $datestamp >one &&
38 git commit -a -m "Common #2" &&
42 echo $datestamp >two &&
44 git commit -a -m "Left #3" &&
46 echo $datestamp >two &&
48 git commit -a -m "Left #4" &&
50 echo $datestamp >two &&
52 git commit -a -m "Left #5" &&
56 echo $datestamp >three &&
59 git commit -a -m "Right #3" &&
61 echo $datestamp >three &&
63 git commit -a -m "Right #4" &&
65 echo $datestamp >three &&
67 git commit -a -m "Right #5" &&
76 test_expect_success
'merge-msg test #1' '
78 git checkout master &&
81 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
82 test_cmp expected actual
86 Merge branch 'left' of $TEST_DIRECTORY/$test
89 test_expect_success
'merge-msg test #2' '
91 git checkout master &&
92 git fetch "$TEST_DIRECTORY/$test" left &&
94 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
95 test_cmp expected actual
109 test_expect_success
'merge-msg test #3-1' '
111 git config --unset-all merge.log
112 git config --unset-all merge.summary
113 git config merge.log true &&
115 git checkout master &&
119 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
120 test_cmp expected actual
123 test_expect_success
'merge-msg test #3-2' '
125 git config --unset-all merge.log
126 git config --unset-all merge.summary
127 git config merge.summary true &&
129 git checkout master &&
133 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
134 test_cmp expected actual
138 Merge branches
'left' and
'right'
155 test_expect_success
'merge-msg test #4-1' '
157 git config --unset-all merge.log
158 git config --unset-all merge.summary
159 git config merge.log true &&
161 git checkout master &&
163 git fetch . left right &&
165 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
166 test_cmp expected actual
169 test_expect_success
'merge-msg test #4-2' '
171 git config --unset-all merge.log
172 git config --unset-all merge.summary
173 git config merge.summary true &&
175 git checkout master &&
177 git fetch . left right &&
179 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
180 test_cmp expected actual
183 test_expect_success
'merge-msg test #5-1' '
185 git config --unset-all merge.log
186 git config --unset-all merge.summary
187 git config merge.log yes &&
189 git checkout master &&
191 git fetch . left right &&
193 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
194 test_cmp expected actual
197 test_expect_success
'merge-msg test #5-2' '
199 git config --unset-all merge.log
200 git config --unset-all merge.summary
201 git config merge.summary yes &&
203 git checkout master &&
205 git fetch . left right &&
207 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
208 test_cmp expected actual