From 0db21f64f5e9a53185674badfcf5776c1ad964b3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 9 Apr 2014 22:42:38 +0000 Subject: mda: set GIT_AUTHOR_DATE in commits as well While we're at it, write some quick tests. --- public-inbox-mda | 1 + t/mda.t | 6 ++++++ 2 files changed, 7 insertions(+) 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 -- cgit v1.2.3-24-ge0c7