From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 85D991F529 for ; Tue, 4 Oct 2022 19:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1664910761; bh=Q4oVLJHku+YrmgDm7Zk9bKkyoYb/FaVARH6okPl72s0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KkVGIkzf4GkqbMN7c4z+ix9pjBiV9Fw0CpQnd1bpfxSPo58pD4iPKyFCcu0BuHftT eNrYbk6V6qBfVXeadxSPGdaq/OrcevPv8M9v6tbuRN4SyLKZggIFTYTDpnAXFytxaj tD9BM/TKW3RVnZQMVh6EIt3vNg6MEdQKraRpqMKE= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/10] git: allow ->local_nick to return undef Date: Tue, 4 Oct 2022 19:12:37 +0000 Message-Id: <20221004191240.1056304-8-e@80x24.org> In-Reply-To: <20221004191240.1056304-1-e@80x24.org> References: <20221004191240.1056304-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-) 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 {