From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EGNPBobzI18UQgAA0tVLHw (envelope-from ) for ; Fri, 31 Jul 2020 10:33:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ALRTAobzI1/yfwAAB5/wlQ (envelope-from ) for ; Fri, 31 Jul 2020 10:33:42 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D640940630 for ; Fri, 31 Jul 2020 10:33:41 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9A13128735; Fri, 31 Jul 2020 06:33:27 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 0BD07200A5 for ; Fri, 31 Jul 2020 06:33:22 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id B4ECC5FAA5; Fri, 31 Jul 2020 06:33:21 -0400 (EDT) Received: (nullmailer pid 1463221 invoked by uid 1000); Fri, 31 Jul 2020 10:33:19 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 2/2] WIP: use new API in notmuch-new Date: Fri, 31 Jul 2020 07:33:13 -0300 Message-Id: <20200731103313.1460011-3-david@tethera.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200731103313.1460011-1-david@tethera.net> References: <20200731103313.1460011-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: FROKRRBYTKDDMRVDWKLVKWRV3PNCUKIU X-Message-ID-Hash: FROKRRBYTKDDMRVDWKLVKWRV3PNCUKIU X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: 8I6BdT1st1f9 --- notmuch-new.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index 4075d395..95ca9971 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -939,11 +939,8 @@ remove_filename (notmuch_database_t *notmuch, status = notmuch_database_begin_atomic (notmuch); if (status) return status; - status = notmuch_database_find_message_by_filename (notmuch, path, &message); - if (status || message == NULL) - goto DONE; - status = notmuch_database_remove_message (notmuch, path); + status = notmuch_database_remove_filename (notmuch, path, &message); if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) { add_files_state->renamed_messages++; if (add_files_state->synchronize_flags == true) @@ -954,7 +951,6 @@ remove_filename (notmuch_database_t *notmuch, } notmuch_message_destroy (message); - DONE: notmuch_database_end_atomic (notmuch); return status; } -- 2.27.0