From f5a937081df8b698b62512684a993fe31990cea0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 28 Jan 2023 11:02:51 +0000 Subject: www_coderepo: fix snapshot link generation 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/); -- cgit v1.2.3-24-ge0c7