From: Eric Wong Date: Tue, 4 Oct 2022 19:12:37 +0000 (+0000) Subject: git: allow ->local_nick to return undef X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ef39974fec81e2f776390965b739a0b37f6a0646;p=public-inbox.git git: allow ->local_nick to return undef It'll be used directly (outside of ->pub_urls) in the standalone coderepo viewer for tarball snapshots. --- 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 {