From ef39974fec81e2f776390965b739a0b37f6a0646 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 4 Oct 2022 19:12:37 +0000 Subject: git: allow ->local_nick to return undef It'll be used directly (outside of ->pub_urls) in the standalone coderepo viewer for tarball snapshots. --- lib/PublicInbox/Git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Git.pm') diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 395add1f..691462ed 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -451,7 +451,7 @@ sub DESTROY { cleanup(@_) } sub local_nick ($) { # don't show full FS path, basename should be OK: - $_[0]->{git_dir} =~ m!/([^/]+?)(?:/*\.git/*)?\z! ? "$1.git" : '???'; + $_[0]->{git_dir} =~ m!/([^/]+?)(?:/*\.git/*)?\z! ? "$1.git" : undef; } sub host_prefix_url ($$) { @@ -478,7 +478,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 { -- cgit v1.2.3-24-ge0c7