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/);

Reply via email to