-# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Local storage (cache/memo) for lei(1), suitable for personal/private
my (undef, $dir, $opt) = @_;
my $eidx = PublicInbox::ExtSearchIdx->new($dir, $opt);
my $self = bless { priv_eidx => $eidx }, __PACKAGE__;
- if ($opt->{creat}) {
- PublicInbox::SearchIdx::load_xapian_writable();
- eidx_init($self);
- }
+ eidx_init($self) if $opt->{creat};
$self;
}
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')