t6300: add more body-parsing tests

The current tests don't actually check parsing commit and tag messages that have both a subject and a body (they just have single-line messages). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Sep 7, 2011 at 13:43 UTC 7140c22c8e98042053d5ff63c8514f5cdf1cb6ed
1 file changed +20
t/t6300-for-each-ref.sh
+20
@@ -37,6 +37,7 @@ test_atom() {
37 case "$1" in
38 head) ref=refs/heads/master ;;
39 tag) ref=refs/tags/testtag ;;
40 + *) ref=$1 ;;
41 esac
42 printf '%s\n' "$3" >expected
43 test_expect_${4:-success} "basic atom: $1 $2" "
@@ -359,4 +360,23 @@ test_expect_success 'an unusual tag with an incomplete line' '
360
361 '
362
363 +test_expect_success 'create tag with subject and body content' '
364 + cat >>msg <<-\EOF &&
365 + the subject line
366 +
367 + first body line
368 + second body line
369 + EOF
370 + git tag -F msg subject-body
371 +'
372 +test_atom refs/tags/subject-body subject 'the subject line'
373 +test_atom refs/tags/subject-body body 'first body line
374 +second body line
375 +'
376 +test_atom refs/tags/subject-body contents 'the subject line
377 +
378 +first body line
379 +second body line
380 +'
381 +
382 test_done