diff options
Diffstat (limited to 't/t4212-log-corrupt.sh')
| -rwxr-xr-x | t/t4212-log-corrupt.sh | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/t/t4212-log-corrupt.sh b/t/t4212-log-corrupt.sh index 22aa8b7c0e..e89e1f54b6 100755 --- a/t/t4212-log-corrupt.sh +++ b/t/t4212-log-corrupt.sh @@ -2,6 +2,7 @@ test_description='git log with invalid commit headers' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_expect_success 'setup' ' @@ -9,7 +10,7 @@ test_expect_success 'setup' ' git cat-file commit HEAD | sed "/^author /s/>/>-<>/" >broken_email.commit && - git hash-object -w -t commit broken_email.commit >broken_email.hash && + git hash-object --literally -w -t commit broken_email.commit >broken_email.hash && git update-ref refs/heads/broken_email $(cat broken_email.hash) ' @@ -20,34 +21,32 @@ test_expect_success 'fsck notices broken commit' ' test_expect_success 'git log with broken author email' ' { - echo commit $(cat broken_email.hash) - echo "Author: A U Thor <author@example.com>" - echo "Date: Thu Apr 7 15:13:13 2005 -0700" - echo + echo commit $(cat broken_email.hash) && + echo "Author: A U Thor <author@example.com>" && + echo "Date: Thu Apr 7 15:13:13 2005 -0700" && + echo && echo " foo" } >expect.out && - : >expect.err && git log broken_email >actual.out 2>actual.err && test_cmp expect.out actual.out && - test_cmp expect.err actual.err + test_must_be_empty actual.err ' test_expect_success 'git log --format with broken author email' ' echo "A U Thor+author@example.com+Thu Apr 7 15:13:13 2005 -0700" >expect.out && - : >expect.err && git log --format="%an+%ae+%ad" broken_email >actual.out 2>actual.err && test_cmp expect.out actual.out && - test_cmp expect.err actual.err + test_must_be_empty actual.err ' munge_author_date () { git cat-file commit "$1" >commit.orig && sed "s/^\(author .*>\) [0-9]*/\1 $2/" <commit.orig >commit.munge && - git hash-object -w -t commit commit.munge + git hash-object --literally -w -t commit commit.munge } test_expect_success 'unparsable dates produce sentinel value' ' |
