From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4AF041FA01 for ; Thu, 25 Mar 2021 04:20:27 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 04/10] lei add-external: do not initialize writable store Date: Thu, 25 Mar 2021 06:20:20 +0200 Message-Id: <20210325042026.11270-5-e@80x24.org> In-Reply-To: <20210325042026.11270-1-e@80x24.org> References: <20210325042026.11270-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There's no need to create or write lei/store when adding an external, we just need to write to the config file. --- lib/PublicInbox/LeiExternal.pm | 2 -- t/lei-externals.t | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/PublicInbox/LeiExternal.pm b/lib/PublicInbox/LeiExternal.pm index 56d6ef39..5e8dc71a 100644 --- a/lib/PublicInbox/LeiExternal.pm +++ b/lib/PublicInbox/LeiExternal.pm @@ -144,8 +144,6 @@ sub add_external_finish { sub lei_add_external { my ($self, $location) = @_; - my $sto = $self->_lei_store(1); - $sto->write_prepare($self); my $opt = $self->{opt}; my $mirror = $opt->{mirror} // do { my @fail; diff --git a/t/lei-externals.t b/t/lei-externals.t index 2045691f..afd90d19 100644 --- a/t/lei-externals.t +++ b/t/lei-externals.t @@ -93,8 +93,7 @@ test_lei(sub { \'added external'); is($lei_out.$lei_err, '', 'no output'); }); - ok(-s $config_file && -e $store_dir, - 'add-external created config + store'); + ok(-s $config_file, 'add-external created config'); my $lcfg = PublicInbox::Config->new($config_file); $cfg->each_inbox(sub { my ($ibx) = @_;