trailer: add test with an old style conflict block
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Nov 9, 2014 at 10:23 UTC
3d24a7267dd9b57b864d119a533bdfdfaccd9161
1 file changed
+31
-1
t/t7513-interpret-trailers.sh
+31
-1
@@ -213,7 +213,7 @@ test_expect_success 'with 2 files arguments' '
213
'
214
215
test_expect_success 'with message that has comments' '
216
- cat basic_message >>message_with_comments &&
216
+ cat basic_message >message_with_comments &&
217
sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
218
# comment
219
@@ -240,6 +240,36 @@ test_expect_success 'with message that has comments' '
240
test_cmp expected actual
241
'
242
243
+test_expect_success 'with message that has an old style conflict block' '
244
+ cat basic_message >message_with_comments &&
245
+ sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
246
+ # comment
247
+
248
+ # other comment
249
+ Cc: Z
250
+ # yet another comment
251
+ Reviewed-by: Johan
252
+ Reviewed-by: Z
253
+ # last comment
254
+
255
+ Conflicts:
256
+
257
+ EOF
258
+ cat basic_message >expected &&
259
+ cat >>expected <<-\EOF &&
260
+ # comment
261
+
262
+ Reviewed-by: Johan
263
+ Cc: Peff
264
+ # last comment
265
+
266
+ Conflicts:
267
+
268
+ EOF
269
+ git interpret-trailers --trim-empty --trailer "Cc: Peff" message_with_comments >actual &&
270
+ test_cmp expected actual
271
+'
272
+
273
test_expect_success 'with commit complex message and trailer args' '
274
cat complex_message_body >expected &&
275
sed -e "s/ Z\$/ /" >>expected <<-\EOF &&