]> Sergey Matveev's repositories - public-inbox.git/commitdiff
clone: move --dry-run handling to lei_mirror
authorEric Wong <e@80x24.org>
Mon, 28 Nov 2022 05:31:55 +0000 (05:31 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Nov 2022 23:38:57 +0000 (23:38 +0000)
lei will probably support dry-run in more places, too.

lib/PublicInbox/LeiMirror.pm
script/public-inbox-clone

index 8b55a7da3000910cd127f5929df2f3d7c3955441..2da4f8815588953289bbb7a81df73b72789afd91 100644 (file)
@@ -938,6 +938,7 @@ sub start_clone_url {
 sub do_mirror { # via wq_io_do or public-inbox-clone
        my ($self) = @_;
        my $lei = $self->{lei};
+       $self->{dry_run} = 1 if $lei->{opt}->{'dry-run'};
        umask($lei->{client_umask}) if defined $lei->{client_umask};
        eval {
                my $ic = $lei->{opt}->{'inbox-config'} //= 'always';
index 59f01b5491309387e05ee18c3af0412975bd3880..4462693655670e004bd1da4542c61ac5361a531b 100755 (executable)
@@ -59,7 +59,6 @@ my $mrr = bless {
 }, 'PublicInbox::LeiMirror';
 
 $? = 0;
-$mrr->{dry_run} = 1 if $lei->{opt}->{'dry-run'};
 $mrr->do_mirror;
 $mrr->can('_wq_done_wait')->([$mrr, $lei], $$);
 exit(($lei->{child_error} // 0) >> 8);