archive: initialize archivers earlier
[gitweb.git] / t / t4205-log-pretty-formats.sh
index 591f35daaf5825cfdcf8e7fccf4f52462bbf8f78..978a8a66ff05055ad1967b5cc25f36880230a5e4 100755 (executable)
@@ -516,22 +516,22 @@ test_expect_success 'log decoration properly follows tag chain' '
        git commit --amend -m shorter &&
        git log --no-walk --tags --pretty="%H %d" --decorate=full >actual &&
        cat <<-EOF >expected &&
-       $head1  (tag: refs/tags/tag2)
        $head2  (tag: refs/tags/message-one)
        $old_head1  (tag: refs/tags/message-two)
+       $head1  (tag: refs/tags/tag2)
        EOF
-       sort actual >actual1 &&
+       sort -k3 actual >actual1 &&
        test_cmp expected actual1
 '
 
 test_expect_success 'clean log decoration' '
        git log --no-walk --tags --pretty="%H %D" --decorate=full >actual &&
        cat >expected <<-EOF &&
-       $head1 tag: refs/tags/tag2
        $head2 tag: refs/tags/message-one
        $old_head1 tag: refs/tags/message-two
+       $head1 tag: refs/tags/tag2
        EOF
-       sort actual >actual1 &&
+       sort -k3 actual >actual1 &&
        test_cmp expected actual1
 '
 
@@ -598,4 +598,27 @@ test_expect_success ':only and :unfold work together' '
        test_cmp expect actual
 '
 
+test_expect_success 'trailer parsing not fooled by --- line' '
+       git commit --allow-empty -F - <<-\EOF &&
+       this is the subject
+
+       This is the body. The message has a "---" line which would confuse a
+       message+patch parser. But here we know we have only a commit message,
+       so we get it right.
+
+       trailer: wrong
+       ---
+       This is more body.
+
+       trailer: right
+       EOF
+
+       {
+               echo "trailer: right" &&
+               echo
+       } >expect &&
+       git log --no-walk --format="%(trailers)" >actual &&
+       test_cmp expect actual
+'
+
 test_done