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); diff --git a/test/T050-new.sh b/test/T050-new.sh index db13090b..6791f87c 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -352,7 +352,6 @@ test_expect_code 1 "NOTMUCH_NEW --debug 2>&1" notmuch config set new.tags $OLDCONFIG test_begin_subtest ".notmuch only ignored at top level" -test_subtest_known_broken generate_message '[dir]=foo/bar/.notmuch/cur' '[subject]="Do not ignore, very important"' NOTMUCH_NEW > OUTPUT notmuch search subject:Do-not-ignore | notmuch_search_sanitize >> OUTPUT