From 993dc7a772b10deda15733c8e750d98bf4d27bd0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Feb 2017 00:06:06 +0000 Subject: [PATCH] config: avoid circular loading dependency We must lazilly load one of them, so load Inbox later since we need to parse the config, first. --- lib/PublicInbox/Config.pm | 2 +- t/config_limiter.t | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index f2c40b13a..15c2a085e 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -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 = {}; diff --git a/t/config_limiter.t b/t/config_limiter.t index f0b652812..04f32cbf2 100644 --- a/t/config_limiter.t +++ b/t/config_limiter.t @@ -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({ -- 2.47.3