- invalid_list(\%ctx, $1) || get_atom(\%ctx);
-
- # thread display
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/t/\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx);
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/t\.mbox(\.gz)?\z!o) {
- my $sfx = $3;
- invalid_list_mid(\%ctx, $1, $2) || get_thread_mbox(\%ctx, $sfx);
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/t\.atom\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_thread_atom(\%ctx);
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/T/\z!o) {
- $ctx{flat} = 1;
- invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx);
-
- # single-message pages
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_mid_html(\%ctx);
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/raw\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_mid_txt(\%ctx);
-
- # full-message page
- } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/f/\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_full_html(\%ctx);
+ invalid_list($self, $ctx, $1) || get_atom($ctx);
+
+ } elsif ($path_info =~ m!$LISTNAME_RE/
+ ($PublicInbox::GitHTTPBackend::ANY)\z!ox) {
+ my $path = $2;
+ invalid_list($self, $ctx, $1) ||
+ serve_git($cgi, $ctx->{git}, $path);
+ } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/$END_RE\z!o) {
+ msg_page($self, $ctx, $1, $2, $3);
+
+ # in case people leave off the trailing slash:
+ } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/(f|T|t|R)\z!o) {
+ my ($listname, $mid, $suffix) = ($1, $2, $3);
+ $suffix .= $suffix =~ /\A[tT]\z/ ? '/#u' : '/';
+ r301($ctx, $listname, $mid, $suffix);