]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: remove *_url_format support for cgit
authorEric Wong <e@80x24.org>
Sat, 23 Oct 2021 20:19:38 +0000 (20:19 +0000)
committerEric Wong <e@80x24.org>
Sat, 23 Oct 2021 21:53:55 +0000 (21:53 +0000)
We're not using them, anywhere.

lib/PublicInbox/Config.pm

index d38f65863a49a6f8f01940e0d59dd74cc44dc1d8..f2e5d5f0801e4c0f566f51ae654bdc55a5112c38 100644 (file)
@@ -328,30 +328,14 @@ sub parse_cgitrc {
 sub _fill_code_repo {
        my ($self, $nick) = @_;
        my $pfx = "coderepo.$nick";
 sub _fill_code_repo {
        my ($self, $nick) = @_;
        my $pfx = "coderepo.$nick";
-
-       my $dir = $self->{"$pfx.dir"}; # aka "GIT_DIR"
-       unless (defined $dir) {
+       my $dir = $self->{"$pfx.dir"} // do { # aka "GIT_DIR"
                warn "$pfx.dir unset\n";
                return;
                warn "$pfx.dir unset\n";
                return;
-       }
-
+       };
        my $git = PublicInbox::Git->new($dir);
        my $git = PublicInbox::Git->new($dir);
-       foreach my $t (qw(blob commit tree tag)) {
-               $git->{$t.'_url_format'} =
-                               _array($self->{lc("$pfx.${t}UrlFormat")});
-       }
-
        if (defined(my $cgits = $self->{"$pfx.cgiturl"})) {
                $git->{cgit_url} = $cgits = _array($cgits);
                $self->{"$pfx.cgiturl"} = $cgits;
        if (defined(my $cgits = $self->{"$pfx.cgiturl"})) {
                $git->{cgit_url} = $cgits = _array($cgits);
                $self->{"$pfx.cgiturl"} = $cgits;
-
-               # cgit supports "/blob/?id=%s", but it's only a plain-text
-               # display and requires an unabbreviated id=
-               foreach my $t (qw(blob commit tag)) {
-                       $git->{$t.'_url_format'} //= map {
-                               "$_/$t/?id=%s"
-                       } @$cgits;
-               }
        }
 
        $git;
        }
 
        $git;