-# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Used throughout the project for reading configuration
$self = config_fh_parse($fh, "\n", '=');
} else {
$self = git_config_dump($file);
+ $self->{'-f'} = $file;
}
bless $self, $class;
# caches
sub _fill_ei ($$) {
my ($self, $pfx) = @_;
- require PublicInbox::ExtSearch;
+ eval { require PublicInbox::ExtSearch } or return;
my $d = $self->{"$pfx.topdir"};
defined($d) && -d $d ? PublicInbox::ExtSearch->new($d) : undef;
}
my ($self, $key, $url) = @_;
state $urlmatch_broken; # requires git 1.8.5
return if $urlmatch_broken;
- my $file = default_file();
+ my $file = $self->{'-f'} // default_file();
my $cmd = [qw/git config -z --includes --get-urlmatch/,
"--file=$file", $key, $url ];
my $fh = popen_rd($cmd);