send-email: add --[no-]xmailer option
[gitweb.git] / t / t4212-log-corrupt.sh
index 80542d624be2881f1aa9242402b494dff8bd5353..67bd8ec020e7919a37c581d3ea7c6c12e70f4276 100755 (executable)
@@ -13,11 +13,16 @@ test_expect_success 'setup' '
        git update-ref refs/heads/broken_email $(cat broken_email.hash)
 '
 
+test_expect_success 'fsck notices broken commit' '
+       test_must_fail git fsck 2>actual &&
+       test_i18ngrep invalid.author actual
+'
+
 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 Jan 1 00:00:00 1970 +0000"
+               echo "Date:   Thu Apr 7 15:13:13 2005 -0700"
                echo
                echo "    foo"
        } >expect.out &&
@@ -30,7 +35,7 @@ test_expect_success 'git log with broken author email' '
 '
 
 test_expect_success 'git log --format with broken author email' '
-       echo "A U Thor+author@example.com+" >expect.out &&
+       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 &&
@@ -76,4 +81,10 @@ test_expect_success 'date parser recognizes time_t overflow' '
        test_cmp expect actual
 '
 
+# date is within 2^63-1, but enough to choke glibc's gmtime
+test_expect_success 'absurdly far-in-future date' '
+       commit=$(munge_author_date HEAD 999999999999999999) &&
+       git log -1 --format=%ad $commit
+'
+
 test_done