3 test_description='git log with invalid commit headers'
7 test_expect_success 'setup' '
10 git cat-file commit HEAD |
11 sed "/^author /s/>/>-<>/" >broken_email.commit &&
12 git hash-object -w -t commit broken_email.commit >broken_email.hash &&
13 git update-ref refs/heads/broken_email $(cat broken_email.hash)
16 test_expect_success 'git log with broken author email' '
18 echo commit $(cat broken_email.hash)
19 echo "Author: A U Thor <author@example.com>"
20 echo "Date: Thu Jan 1 00:00:00 1970 +0000"
26 git log broken_email >actual.out 2>actual.err &&
28 test_cmp expect.out actual.out &&
29 test_cmp expect.err actual.err
32 test_expect_success 'git log --format with broken author email' '
33 echo "A U Thor+author@example.com+" >expect.out &&
36 git log --format="%an+%ae+%ad" broken_email >actual.out 2>actual.err &&
38 test_cmp expect.out actual.out &&
39 test_cmp expect.err actual.err