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 7D6DE1F66F for ; Sun, 15 Nov 2020 23:27:23 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] v2writable: avoid initiating leftover unindex if interrupted Date: Sun, 15 Nov 2020 23:27:23 +0000 Message-Id: <20201115232723.26850-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can also avoid a needless progress message on log2stack interruptions, too. --- lib/PublicInbox/V2Writable.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 5bac04a4..ba7cef13 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -1085,13 +1085,14 @@ sub sync_prepare ($$) { # messages to show up in mirrors, too. $sync->{D} //= $sync->{reindex} ? {} : undef; # OID_BIN => NR my $stk = log2stack($sync, $git, $range); + return 0 if $sync->{quit}; my $nr = $stk ? $stk->num_records : 0; $pr->("$nr\n") if $pr; $unit->{stack} = $stk; # may be undef unshift @{$sync->{todo}}, $unit; $regen_max += $nr; - last if $sync->{quit}; } + return 0 if $sync->{quit}; # XXX this should not happen unless somebody bypasses checks in # our code and blindly injects "d" file history into git repos