]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: include listname on lookup
authorEric Wong <e@80x24.org>
Wed, 9 Apr 2014 19:32:18 +0000 (19:32 +0000)
committerEric Wong <e@80x24.org>
Wed, 9 Apr 2014 19:32:18 +0000 (19:32 +0000)
We will be using it when setting GIT_COMMITTER_NAME

lib/PublicInbox/Config.pm
t/config.t

index b6885a3108dfec79b72d5d28e25f8e8644605a44..300dd88bf2bd5bd402339379ac47552ada3ec219 100644 (file)
@@ -35,6 +35,9 @@ sub lookup {
        my %rv = map {
                $_ => $self->{"$pfx.$_"}
        } (qw(mainrepo description address));
+       my $listname = $pfx;
+       $listname =~ s/\Apublicinbox\.//;
+       $rv{listname} = $listname;
        \%rv;
 }
 
index 145589ead5d227e50e21a84589d7b1ee0b770a2a..44e051f2f939caab3f3b040f369ffec70055e1a5 100644 (file)
@@ -28,7 +28,8 @@ my $tmpdir = tempdir(CLEANUP => 1);
        is_deeply($cfg->lookup('bugs@public-inbox.org'), {
                'mainrepo' => '/home/pi/bugs-main.git',
                'address' => 'bugs@public-inbox.org',
-               'description' => 'development discussion'
+               'description' => 'development discussion',
+               'listname' => 'bugs',
        }, "lookup matches expected output");
 
        is($cfg->lookup('blah@example.com'), undef,