From: Eric Wong Date: Wed, 9 Apr 2014 22:42:38 +0000 (+0000) Subject: mda: set GIT_AUTHOR_DATE in commits as well X-Git-Tag: v1.0.0~1287 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=0db21f64f5e9a53185674badfcf5776c1ad964b3;p=public-inbox.git mda: set GIT_AUTHOR_DATE in commits as well While we're at it, write some quick tests. --- diff --git a/public-inbox-mda b/public-inbox-mda index 14017f68..411ac15f 100755 --- a/public-inbox-mda +++ b/public-inbox-mda @@ -52,6 +52,7 @@ if (PublicInbox->precheck($filter, $recipient) && defined $email or $email = ""; local $ENV{GIT_AUTHOR_NAME} = $name; local $ENV{GIT_AUTHOR_EMAIL} = $email; + local $ENV{GIT_AUTHOR_DATE} = $simple->header("Date"); local $ENV{GIT_COMMITTER_EMAIL} = $recipient; local $ENV{GIT_COMMITTER_NAME} = $dst->{listname}; diff --git a/t/mda.t b/t/mda.t index 755864ca..de30b125 100644 --- a/t/mda.t +++ b/t/mda.t @@ -64,6 +64,12 @@ EOF local $ENV{GIT_DIR} = $maindir; my $rev = `git rev-list HEAD`; like($rev, qr/\A[a-f0-9]{40}/, "good revision committed"); + chomp $rev; + my $cmt = `git cat-file commit $rev`; + like($cmt, qr/^author Me 0 \+0000\n/m, + "author info set correctly"); + like($cmt, qr/^committer test /m, + "committer info set correctly"); } # ensure failures work