]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
config: avoid circular loading dependency
authorEric Wong <e@80x24.org>
Wed, 15 Feb 2017 00:06:06 +0000 (00:06 +0000)
committerEric Wong <e@80x24.org>
Wed, 15 Feb 2017 19:21:24 +0000 (19:21 +0000)
We must lazilly load one of them, so load Inbox later
since we need to parse the config, first.

lib/PublicInbox/Config.pm
t/config_limiter.t

index f2c40b13ab73ce1f51cb3ed849bb2f1ed3e3b1f4..15c2a085eb4d633e7a6e169afab563e089eb9fb6 100644 (file)
@@ -5,7 +5,6 @@
 package PublicInbox::Config;
 use strict;
 use warnings;
-require PublicInbox::Inbox;
 use PublicInbox::Spawn qw(popen_rd);
 
 # returns key-value pairs of config directives in a hash
@@ -131,6 +130,7 @@ sub git_config_dump {
 }
 
 sub _fill {
+       require PublicInbox::Inbox;
        my ($self, $pfx) = @_;
        my $rv = {};
 
index f0b6528122e05fbd5d4773563ab718ba1a3e03bf..04f32cbf2df68d5025266a90ddba2214f2844fbb 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::Config;
+use PublicInbox::Inbox;
 my $cfgpfx = "publicinbox.test";
 {
        my $config = PublicInbox::Config->new({