about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-04 10:34:04 +0000
committerEric Wong <e@80x24.org>2023-01-05 09:58:55 +0000
commit44fbd4169f7434442dbf57851232edafa6fd0e46 (patch)
treec042e883b8debdc45debbdaea8e61e97bcb04db5 /lib/PublicInbox/Git.pm
parenta0646591eacd2403476545ac4569bd7c551e67cf (diff)
downloadpublic-inbox-44fbd4169f7434442dbf57851232edafa6fd0e46.tar.gz
Since we have native coderepo viewing support without cgit,
configuring coderepo.$FOO.cgitUrl shouldn't be necessary anymore
and we can infer the public name based on the project nickname
(or whatever's in the generated project.list)
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index d8468b4f..96627daa 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -485,10 +485,11 @@ sub host_prefix_url ($$) {
 
 sub base_url { # for coderepos, PSGI-only
         my ($self, $env) = @_; # env - PSGI env
+        my $nick = $self->{nick} // return undef;
         my $url = host_prefix_url($env, '');
         # for mount in Plack::Builder
         $url .= '/' if substr($url, -1, 1) ne '/';
-        $url . $self->{nick} . '/';
+        $url . $nick . '/';
 }
 
 sub isrch {} # TODO
@@ -496,9 +497,10 @@ sub isrch {} # TODO
 sub pub_urls {
         my ($self, $env) = @_;
         if (my $urls = $self->{cgit_url}) {
-                return map { host_prefix_url($env, $_) } @$urls;
+                map { host_prefix_url($env, $_) } @$urls;
+        } else {
+                (base_url($self, $env) // '???');
         }
-        (local_nick($self) // '???');
 }
 
 sub cat_async_begin {