X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwCoderepo.pm;h=668b639881a06a9be1a9fcb253e0dc1a03944496;hb=1c5e51b931fb2a00df28dd5e81d1766b63e389b3;hp=2fba0cd0be4571152b1e1f4fe49c068f2a22b499;hpb=eea4b03f08b40647b7cf6016838d18ae26d98a08;p=public-inbox.git diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm index 2fba0cd0..668b6398 100644 --- a/lib/PublicInbox/WwwCoderepo.pm +++ b/lib/PublicInbox/WwwCoderepo.pm @@ -18,6 +18,7 @@ use PublicInbox::Hval qw(ascii_html); use PublicInbox::ViewDiff qw(uri_escape_path); use PublicInbox::RepoSnapshot; use PublicInbox::RepoAtom; +use PublicInbox::RepoTree; my $EACH_REF = "git for-each-ref --sort=-creatordate --format='%(HEAD)%00". join('%00', map { "%($_)" } @@ -226,6 +227,11 @@ sub srv { # endpoint called by PublicInbox::WWW ($ctx->{git} = $cr->{$1}) and return PublicInbox::ViewVCS::show($ctx, $2); + if ($path_info =~ m!\A/(.+?)/tree/(.*)\z! and + ($ctx->{git} = $cr->{$1})) { + return PublicInbox::RepoTree::srv_tree($ctx, $2) // r(404); + } + # snapshots: if ($path_info =~ m!\A/(.+?)/snapshot/([^/]+)\z! and ($ctx->{git} = $cr->{$1})) {