From c76fc3965c990e5624588f2abcf2d8912e58ea35 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Nov 2022 05:32:27 +0000 Subject: lei_mirror: omit trailing slash for git remote.*.url 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. --- lib/PublicInbox/LeiMirror.pm | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3-24-ge0c7