about summary refs log tree commit homepage
path: root/lib/PublicInbox/Cgit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-31 10:30:13 +0000
committerEric Wong <e@80x24.org>2020-01-01 07:51:04 +0000
commit0a3ead80bc685fcabed9f7dfaae35c74b72cd830 (patch)
tree18dd5969d75873dfac4465564c8aa36f5e6395db /lib/PublicInbox/Cgit.pm
parenta7d4f457ec2b4531b3aaeb6cef1383bbda5b431a (diff)
downloadpublic-inbox-0a3ead80bc685fcabed9f7dfaae35c74b72cd830.tar.gz
AFAIK this doesn't do anything for Perl internally since
PublicInbox::Git doesn't "use fields", but it makes it easier for
humans readers to follow and ensure we're not passing unblessed
or non-ref scalars to PublicInbox::GitHTTPBackend::serve.
Diffstat (limited to 'lib/PublicInbox/Cgit.pm')
-rw-r--r--lib/PublicInbox/Cgit.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Cgit.pm b/lib/PublicInbox/Cgit.pm
index ab4065bd..36239438 100644
--- a/lib/PublicInbox/Cgit.pm
+++ b/lib/PublicInbox/Cgit.pm
@@ -8,6 +8,7 @@
 package PublicInbox::Cgit;
 use strict;
 use PublicInbox::GitHTTPBackend;
+use PublicInbox::Git;
 # not bothering with Exporter for a one-off
 *r = *PublicInbox::GitHTTPBackend::r;
 *input_prepare = *PublicInbox::GitHTTPBackend::input_prepare;
@@ -109,7 +110,7 @@ sub call {
         # handle requests without spawning cgit iff possible:
         if ($path_info =~ m!\A/(.+?)/($PublicInbox::GitHTTPBackend::ANY)\z!ox) {
                 my ($nick, $path) = ($1, $2);
-                if (my $git = $self->{"\0$nick"}) {
+                if (my PublicInbox::Git $git = $self->{"\0$nick"}) {
                         return serve($env, $git, $path);
                 }
         } elsif ($path_info =~ m!$self->{static}! &&