about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-11-28 05:32:27 +0000
committerEric Wong <e@80x24.org>2022-11-28 23:38:59 +0000
commitc76fc3965c990e5624588f2abcf2d8912e58ea35 (patch)
tree4bdcee97bd2d7dd73a168b4fdcbd1af3771a8829
parent61c01dc4b39fc5ba2ba85456fb4363d8f311cca5 (diff)
downloadpublic-inbox-c76fc3965c990e5624588f2abcf2d8912e58ea35.tar.gz
While PublicInbox::WWW URLs have a trailing slash in them
for compatibility with static web server mirrors, URLs
intended for `git clone' don't benefit from this and the
trailing `/' just looks awkward.
-rw-r--r--lib/PublicInbox/LeiMirror.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index cf4e58f1..5b7cf9e6 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -533,6 +533,8 @@ sub clone_v1 {
         my $lei = $self->{lei};
         my $curl = $self->{curl} //= PublicInbox::LeiCurl->new($lei) or return;
         my $uri = URI->new($self->{cur_src} // $self->{src});
+        my $path = $uri->path;
+        $path =~ s!/*\z!! and $uri->path($path);
         defined($lei->{opt}->{epoch}) and
                 die "$uri is a v1 inbox, --epoch is not supported\n";
         $self->{-torsocks} //= $curl->torsocks($lei, $uri) or return;