]> Sergey Matveev's repositories - public-inbox.git/commitdiff
learn: GIT_COMMITTER_<NAME|EMAIL> may be "" or "0"
authorEric Wong <e@80x24.org>
Mon, 28 Oct 2019 10:45:18 +0000 (10:45 +0000)
committerEric Wong <e@80x24.org>
Wed, 30 Oct 2019 08:48:11 +0000 (08:48 +0000)
Users may be zeroes or blanks.

script/public-inbox-learn

index ad1329859ce253304507046547667ad21c45464e..299f75a0e58ae319d6e46ee068db1f20c1af10dd 100755 (executable)
@@ -65,8 +65,8 @@ if ($train eq 'spam') {
                next unless ref($dst);
                # We do not touch GIT_COMMITTER_* env here so we can track
                # who trained the message.
-               $dst->{name} = $ENV{GIT_COMMITTER_NAME} || $dst->{name};
-               $dst->{-primary_address} = $ENV{GIT_COMMITTER_EMAIL} || $addr;
+               $dst->{name} = $ENV{GIT_COMMITTER_NAME} // $dst->{name};
+               $dst->{-primary_address} = $ENV{GIT_COMMITTER_EMAIL} // $addr;
                $dst = PublicInbox::InboxWritable->new($dst);
                my $im = $dst->importer(0);