From 0a3ead80bc685fcabed9f7dfaae35c74b72cd830 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 31 Dec 2019 10:30:13 +0000 Subject: cgit: type declaration for PublicInbox::Git 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. --- lib/PublicInbox/Cgit.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Cgit.pm') 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}! && -- cgit v1.2.3-24-ge0c7