about summary refs log tree commit homepage
path: root/lib/PublicInbox/Config.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-11 02:45:37 -0800
committerEric Wong <e@80x24.org>2021-03-11 16:35:21 -0400
commitf8911d2ec389880adb5faca49f1fdf816a819561 (patch)
tree99ae7fa50a53399b64497dce65d9bc87ec7b1cfa /lib/PublicInbox/Config.pm
parent2e64d01eee123cc1ce2bec7dc43df53b5322d344 (diff)
downloadpublic-inbox-f8911d2ec389880adb5faca49f1fdf816a819561.tar.gz
This fixes ->urlmatch use from lei, which already sets '-f'.
I noticed this because imap.$URL.compress was ignored in
my lei config file.
Diffstat (limited to 'lib/PublicInbox/Config.pm')
-rw-r--r--lib/PublicInbox/Config.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index a4b1756d..87a03fd3 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -26,6 +26,7 @@ sub new {
                 $self = config_fh_parse($fh, "\n", '=');
         } else {
                 $self = git_config_dump($file);
+                $self->{'-f'} = $file;
         }
         bless $self, $class;
         # caches
@@ -505,7 +506,7 @@ sub urlmatch {
         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);