From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E8A9B1F5CB for ; Tue, 24 Sep 2024 18:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1727202949; bh=1hjQwbtkUoUmmuZ6YcR/tmanBd/bukKGoM6EftvIAaw=; h=From:To:Subject:Date:From; b=jNcK8S2Ao2hhZ+Z/dcFQMPB0QfayYFRRYxR273my+dWrurubjiCDSFTQi7V+ycmGa Qezh4MePelPI7xnPrSk4jiFaLfaLMI0VW4Q1PsL1wEP2IOxhi8gb0E1hBiheTLgU2v S5xJT/GPp21rJBiBHUFIwEAIO+x8kC6HTdUFVDKY= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] viewvcs: fix b= generation in $REPO/tree/ listing Date: Tue, 24 Sep 2024 18:35:48 +0000 Message-ID: <20240924183548.509216-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 .= <