unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] viewvcs: fix b= generation in $REPO/tree/ listing
@ 2024-09-24 18:35 Eric Wong
  2024-09-25  6:28 ` Štěpán Němec
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2024-09-24 18:35 UTC (permalink / raw)
  To: meta

Queries such as `b=contrib/cssREADME' are incorrect despite
having the actual blob OID for the given file.  Add a trailing
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.
---
 lib/PublicInbox/ViewVCS.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm
index 3e604901..e556a0e2 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 .= <<EOM
 \n\$ git ls-tree -l $t	# shows similar output on the CLI
 EOM

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-25 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-24 18:35 [PATCH] viewvcs: fix b= generation in $REPO/tree/ listing Eric Wong
2024-09-25  6:28 ` Štěpán Němec
2024-09-25 21:50   ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).