From 2d3debbcf3fa4a4f0705624a897cf43547e5bf32 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Mar 2016 08:10:58 +0000 Subject: [PATCH] repobrowse: improve API consistency, harder This allows RepobrowseConfig objects to passed directly to Repobrowse initialization, similar to the way the normal Config can be passed to WWW at initialization. --- lib/PublicInbox/Repobrowse.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Repobrowse.pm b/lib/PublicInbox/Repobrowse.pm index fe06a5bef..0b09800bc 100644 --- a/lib/PublicInbox/Repobrowse.pm +++ b/lib/PublicInbox/Repobrowse.pm @@ -29,8 +29,9 @@ my %VCS = (git => 'Git'); my %LOADED; sub new { - my ($class, $file) = @_; - bless { rconfig => PublicInbox::RepobrowseConfig->new($file) }, $class; + my ($class, $rconfig) = @_; + $rconfig ||= PublicInbox::RepobrowseConfig->new; + bless { rconfig => $rconfig }, $class; } # simple response for errors -- 2.47.3