about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiStore.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-31 19:20:59 -1400
committerEric Wong <e@80x24.org>2021-01-01 20:55:31 +0000
commit171a9c24022ad7efef9248fc51fc357eed6aeb8a (patch)
tree7501b50755de45f76f42063fd4d5b698b592fe9c /lib/PublicInbox/LeiStore.pm
parentaf0b0fb7a454470a32c452119d0392e0dedb3fe1 (diff)
downloadpublic-inbox-171a9c24022ad7efef9248fc51fc357eed6aeb8a.tar.gz
$git->qx and $git->popen now $env and $opt for redirects
like lower-level popen_rd.  This may be beneficial in other
places.
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r--lib/PublicInbox/LeiStore.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index a23efed5..7c62ffea 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -54,7 +54,9 @@ sub git_epoch_max  {
 
 sub git_ident ($) {
         my ($git) = @_;
-        chomp(my $i = $git->qx(qw(var GIT_COMMITTER_IDENT)));
+        open my $null, '>', '/dev/null' or die "open /dev/null: $!";
+        my $opt = { 2 => $null };
+        chomp(my $i = $git->qx(qw(var GIT_COMMITTER_IDENT), undef, $opt));
         warn "$git->{git_dir} GIT_COMMITTER_IDENT failed\n" if $?;
         $i =~ /\A(.+) <([^>]+)> [0-9]+ [-\+]?[0-9]+$/ ? ($1, $2) :
                 ('lei user', 'x@example.com')