]> Sergey Matveev's repositories - public-inbox.git/commitdiff
learn: fix uninitialized variable
authorEric Wong <e@80x24.org>
Tue, 26 Jul 2016 00:46:52 +0000 (00:46 +0000)
committerEric Wong <e@80x24.org>
Tue, 26 Jul 2016 00:46:52 +0000 (00:46 +0000)
Oops :x

script/public-inbox-learn
t/mda.t

index 09fd7c8f43409865471acbe481a82ad149b43ebd..396ab48992bcbd47c6cbc524eb94a0628ff318da 100755 (executable)
@@ -57,7 +57,7 @@ foreach my $recipient (keys %dests) {
        my $git = PublicInbox::Git->new($git_dir);
        # We do not touch GIT_COMMITTER_* env here so we can track
        # who trained the message.
-       my $name = $ENV{GIT_COMMITTER_NAME} || $dst->{inbox};
+       my $name = $ENV{GIT_COMMITTER_NAME} || $dst->{name};
        my $email = $ENV{GIT_COMMITTER_EMAIL} || $recipient;
        my $im = PublicInbox::Import->new($git, $name, $email);
 
diff --git a/t/mda.t b/t/mda.t
index 32154bdce7e597b12607d112dab7047640e31943..886b4cb973c5a0bfdcd0095d9d2105848264c843 100644 (file)
--- a/t/mda.t
+++ b/t/mda.t
@@ -187,6 +187,7 @@ EOF
                # now train it
                local $ENV{GIT_AUTHOR_EMAIL} = 'trainer@example.com';
                local $ENV{GIT_COMMITTER_EMAIL} = 'trainer@example.com';
+               local $ENV{GIT_COMMITTER_NAME} = undef;
                IPC::Run::run([$learn, "spam"], \$msg);
                is($?, 0, "no failure from learning spam");
                IPC::Run::run([$learn, "spam"], \$msg);