about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiQuery.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r--lib/PublicInbox/LeiQuery.pm15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index 56b82acc..effc572f 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -95,18 +95,11 @@ sub lxs_prepare {
                 }
                 # --external is enabled by default, but allow --no-external
                 if ($opt->{external} //= 1) {
-                        my %x;
-                        for my $loc (@{$opt->{exclude} // []}) {
-                                my @l = $self->get_externals($loc, 1) or return;
-                                $x{$_} = 1 for @l;
-                        }
-                        my $ne = $self->externals_each(\&prep_ext, $lxs, \%x);
+                        my $ex = $self->canonicalize_excludes($opt->{exclude});
+                        $self->externals_each(\&prep_ext, $lxs, $ex);
                         $opt->{remote} //= !($lxs->locals - $opt->{'local'});
-                        if ($opt->{'local'}) {
-                                $lxs->{remotes} = \@iremotes if !$opt->{remote};
-                        } else {
-                                $lxs->{locals} = \@ilocals;
-                        }
+                        $lxs->{locals} = \@ilocals if !$opt->{'local'};
+                        $lxs->{remotes} = \@iremotes if !$opt->{remote};
                 }
         }
         ($lxs->locals || $lxs->remotes) ? ($self->{lxs} = $lxs) :