aboutsummaryrefslogtreecommitdiff
path: root/notmuch-new.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-12-26 08:24:10 -0400
committerDavid Bremner <david@tethera.net>2022-01-16 10:52:13 -0400
commit6472dbf4b7fdec3bd59d7622ef477a035e34c67a (patch)
tree31a960ac9910836006175c54fa7c145d924fc5e1 /notmuch-new.c
parentfd6d50b38f8d8529191f6c9b637ecb458018baa3 (diff)
cli/new: only ignore .notmuch at top level
Since the bug was first reported in [1], notmuch has gained the ability to have the database located outside the mail root, hence this this change differs slightly from Jani's proposed solution [2] in not using notmuch_database_get_path, but rather the already retrieved mail_root. [1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org [2]: id:87ios5v59p.fsf@nikula.org
Diffstat (limited to 'notmuch-new.c')
-rw-r--r--notmuch-new.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index 5b8fa340..346e6469 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -601,11 +601,12 @@ add_files (notmuch_database_t *notmuch,
continue;
}
- /* Ignore the .notmuch directory and any "tmp" directory
+ /* Ignore any top level .notmuch directory and any "tmp" directory
* that appears within a maildir.
*/
if ((is_maildir && strcmp (entry->d_name, "tmp") == 0) ||
- strcmp (entry->d_name, ".notmuch") == 0)
+ (strcmp (entry->d_name, ".notmuch") == 0
+ && (strcmp (path, state->mail_root)) == 0))
continue;
next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);