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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 B6FF51F5AF for ; Mon, 29 Mar 2021 23:58:54 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] git: local_nick: handle trailing or redundant '/' in git_dir Date: Mon, 29 Mar 2021 23:58:54 +0000 Message-Id: <20210329235854.23687-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Some cgit configs use trailing slashes in pathnames which we preserve internally. Before this change, trailing slashes in cgit config files was causing ViewVCS (SolverGit) output to show up as "???" for coderepos without cgitUrl configured. --- lib/PublicInbox/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 2ae5eff9..96ac17a3 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -426,7 +426,7 @@ sub local_nick ($) { my ($self) = @_; my $ret = '???'; # don't show full FS path, basename should be OK: - if ($self->{git_dir} =~ m!/([^/]+)(?:/\.git)?\z!) { + if ($self->{git_dir} =~ m!/([^/]+)(?:/*\.git/*)?\z!) { $ret = "$1.git"; } wantarray ? ($ret) : $ret;