about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-28 11:02:51 +0000
committerEric Wong <e@80x24.org>2023-01-28 18:52:32 +0000
commitf5a937081df8b698b62512684a993fe31990cea0 (patch)
tree5238647979f65bb68e0a3d61c47f4a77240d6576
parentd3c6f8e57b15e8d3de0431c8419bdd0497ec3d32 (diff)
downloadpublic-inbox-f5a937081df8b698b62512684a993fe31990cea0.tar.gz
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.
-rw-r--r--lib/PublicInbox/WwwCoderepo.pm6
1 files 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/);