about summary refs log tree commit homepage
path: root/lib/PublicInbox/Repobrowse.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-07 08:10:58 +0000
committerEric Wong <e@80x24.org>2016-04-05 18:58:27 +0000
commit2d3debbcf3fa4a4f0705624a897cf43547e5bf32 (patch)
tree5d54470ea9a4e90f924b41921f8b12696277d62c /lib/PublicInbox/Repobrowse.pm
parent9c8e361c7270da7cb665257e01d221e46bbf00a3 (diff)
downloadpublic-inbox-2d3debbcf3fa4a4f0705624a897cf43547e5bf32.tar.gz
This allows RepobrowseConfig objects to passed directly
to Repobrowse initialization, similar to the way the normal
Config can be passed to WWW at initialization.
Diffstat (limited to 'lib/PublicInbox/Repobrowse.pm')
-rw-r--r--lib/PublicInbox/Repobrowse.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Repobrowse.pm b/lib/PublicInbox/Repobrowse.pm
index fe06a5be..0b09800b 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