From: Eric Wong Date: Tue, 24 Sep 2024 18:35:48 +0000 (+0000) Subject: viewvcs: fix b= generation in $REPO/tree/ listing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d39bc7f648dc59abe1f4b7eb086e78af74fe25fc;p=thirdparty%2Fpublic-inbox.git viewvcs: fix b= generation in $REPO/tree/ listing Queries such as `b=contrib/cssREADME' are incorrect despite having the actual blob OID for the given file. Add a trailing slash for files in a project subdirectory in those cases as we do for cases we don't have a known path name. While we're in the area, avoid needless shadowing of the `$t' var and add a comment to describe its contents. --- diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index b69214bc8..14c2e4e3d 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -409,8 +409,9 @@ sub show_tree_result ($$) { my $upfx = $ctx->{-upfx} //= '../../'; if (defined $pfx) { $pfx =~ s!/+\z!!s; - if (my $t = $ctx->{-obj}) { - my $t = ascii_html($t); + if (my $t = $ctx->{-obj}) { # $t eq "$tip:$path" + $t = ascii_html($t); + $pfx .= '/' if $pfx ne ''; $$bref .= <