diff options
author | Eric Wong <e@80x24.org> | 2021-10-23 20:19:37 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-10-23 21:53:55 +0000 |
commit | 7b7d4bd01b564969eb0c1904a5bd9ee4f3dbba72 (patch) | |
tree | 943bc6af40d4068456d5f2038d6f972d0ff42c60 /lib/PublicInbox/Git.pm | |
parent | e6b5ef6a248f5808fff0483f02bd73dcbfea8c0a (diff) | |
download | public-inbox-7b7d4bd01b564969eb0c1904a5bd9ee4f3dbba72.tar.gz |
We need to use a non-greedy regexp to avoid capturing the ".git" suffix in the pathname before blindly appending our own.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index e634ca55..374a3b4d 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -442,13 +442,8 @@ sub packed_bytes { sub DESTROY { cleanup(@_) } sub local_nick ($) { - my ($self) = @_; - my $ret = '???'; # don't show full FS path, basename should be OK: - if ($self->{git_dir} =~ m!/([^/]+)(?:/*\.git/*)?\z!) { - $ret = "$1.git"; - } - wantarray ? ($ret) : $ret; + $_[0]->{git_dir} =~ m!/([^/]+?)(?:/*\.git/*)?\z! ? "$1.git" : '???'; } sub host_prefix_url ($$) { @@ -465,7 +460,7 @@ sub pub_urls { if (my $urls = $self->{cgit_url}) { return map { host_prefix_url($env, $_) } @$urls; } - local_nick($self); + (local_nick($self)); } sub cat_async_begin { |