]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
cindex: --associate fails when no inboxes are given
authorEric Wong <e@80x24.org>
Tue, 24 Oct 2023 11:44:27 +0000 (11:44 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 Oct 2023 20:04:28 +0000 (20:04 +0000)
This functionality still needs to be fleshed out, but we
definitely can't associate coderepos to inboxes if we don't have
any inboxes as candidates.

lib/PublicInbox/CodeSearchIdx.pm

index 36d00aea7e31184162287b509134b974092a838c..2d1d8b223cd4e24df7e51aa236f8a01b78428e68 100644 (file)
@@ -930,9 +930,8 @@ sub init_associate_postfork ($) {
        require_progs('associate', join => \@JOIN);
        $QRY_STR = $self->{-opt}->{'associate-date-range'} // '1.year.ago..';
        substr($QRY_STR, 0, 0) = 'dt:';
-       scalar(@{$self->{git_dirs} //  []}) or die <<EOM;
-E: no coderepos to associate
-EOM
+       @{$self->{git_dirs} // []} or die "E: no coderepos to associate\n";
+       @IBX or die "E: no inboxes to associate\n";
        my $approx_git = PublicInbox::Git->new($self->{git_dirs}->[0]); # ugh
        $self->query_approxidate($approx_git, $QRY_STR); # in-place
        $TODO{associate} = PublicInbox::OnDestroy->new($$, \&associate, $self);