]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_store: quiet down git user info being unset
authorEric Wong <e@80x24.org>
Thu, 1 Apr 2021 12:10:41 +0000 (17:10 +0500)
committerEric Wong <e@80x24.org>
Thu, 1 Apr 2021 18:25:15 +0000 (18:25 +0000)
lei_store contents aren't intended to become public, so there's
no point in nagging users for their email address for git
committer information like git does.

lib/PublicInbox/LeiStore.pm

index f2aa45bd0d41c4335372e78c5bbd55c8673a1e99..8574d736ebd37336ef92463178707753a318d02b 100644 (file)
@@ -51,8 +51,9 @@ sub git_epoch_max  {
 
 sub git_ident ($) {
        my ($git) = @_;
-       chomp(my $i = $git->qx(qw(var GIT_COMMITTER_IDENT)));
-       warn "$git->{git_dir} GIT_COMMITTER_IDENT failed\n" if $?;
+       my $rdr = {};
+       open $rdr->{2}, '>', '/dev/null' or die "open /dev/null: $!";
+       chomp(my $i = $git->qx([qw(var GIT_COMMITTER_IDENT)], undef, $rdr));
        $i =~ /\A(.+) <([^>]+)> [0-9]+ [-\+]?[0-9]+$/ ? ($1, $2) :
                ('lei user', 'x@example.com')
 }