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,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 A8C081FA29 for ; Sat, 28 Jan 2023 11:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1674903803; bh=0XIhv1gdrmwTsRTdXtyaAVIOiB3/R1XqChOYgWI4YsA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PDRKdPdWtRLLB4F/QAvfDqsawUo45OnKsmg8BuTGpjYQ6X8VU3TcJNpvjEJwUOxoF ILW0K3U4NmMb6rCX3EQ6QwKAK4fgaYs9TS3JBnZSIYgrz213uQIvQXehjP/wy0Fbnc K1P2nvQ4qxTJKslQgknpBzjGx6tXVgOjaSUQA0jY= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/7] www_coderepo: fix snapshot link generation Date: Sat, 28 Jan 2023 11:02:51 +0000 Message-Id: <20230128110255.2950084-4-e@80x24.org> In-Reply-To: <20230128110255.2950084-1-e@80x24.org> References: <20230128110255.2950084-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Do not assume ".git" exists as a suffix in the repo nickname, and filter out all trailing slashes in case it didn't get filtered from Config. --- lib/PublicInbox/WwwCoderepo.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm index e3d45c56..4d8713b4 100644 --- a/lib/PublicInbox/WwwCoderepo.pm +++ b/lib/PublicInbox/WwwCoderepo.pm @@ -142,9 +142,9 @@ EOM my $n; if (@s) { $n = $ctx->{git}->local_nick // die "BUG: $ctx->{git_dir} nick"; - $n =~ s/\.git\z/-/; - ($n) = ($n =~ m!([^/]+)\z!); - $n = ascii_html($n); + $n =~ s!\.git/*\z!!; + ($n) = ($n =~ m!([^/]+)/*\z!); + $n = ascii_html($n).'-'; } for (@r) { my (undef, $oid, $ref, $s, $cd) = split(/\0/);