From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D34F31FC0B for ; Thu, 11 Mar 2021 10:45:38 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 6/7] config: use '-f' key to store config file pathname Date: Thu, 11 Mar 2021 02:45:37 -0800 Message-Id: <20210311104538.7743-7-e@80x24.org> In-Reply-To: <20210311104538.7743-1-e@80x24.org> References: <20210311104538.7743-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This fixes ->urlmatch use from lei, which already sets '-f'. I noticed this because imap.$URL.compress was ignored in my lei config file. --- lib/PublicInbox/Config.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);