goto DONE;
}
- /*
- * XXX: The library does not have a function to remove a directory
- * document for a path. Usually this doesn't matter except for a
- * slight waste of space. However, if the directory gets added to
- * the filesystem again, the old directory document is found with
- * the old mtime. Reset the directory mtime to avoid problems.
- */
- notmuch_directory_set_mtime (directory, 0);
+ status = notmuch_directory_delete (directory);
DONE:
- notmuch_directory_destroy (directory);
+ if (status)
+ notmuch_directory_destroy (directory);
return status;
}
test_begin_subtest "Deleted directory"
-test_subtest_known_broken
rm -rf "${MAIL_DIR}"/dir-renamed
output=$(NOTMUCH_NEW --debug)
test_begin_subtest "New directory (at end of list)"
-test_subtest_known_broken
generate_message [dir]=zzz
generate_message [dir]=zzz
test_begin_subtest "Deleted directory (end of list)"
-test_subtest_known_broken
rm -rf "${MAIL_DIR}"/zzz
output=$(NOTMUCH_NEW --debug)
No new mail. Removed 3 messages."
test_begin_subtest "Support single-message mbox"
-test_subtest_known_broken
cat > "${MAIL_DIR}"/mbox_file1 <<EOF
From test_suite@notmuchmail.org Fri Jan 5 15:43:57 2001
From: Notmuch Test Suite <test_suite@notmuchmail.org>
# This test requires that notmuch new has been run at least once.
test_begin_subtest "Skip and report non-mail files"
-test_subtest_known_broken
generate_message
mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config
touch "${MAIL_DIR}"/ignored_file
test_expect_equal "$output" "Added 1 new message to the database."
test_begin_subtest "Ignore files and directories specified in new.ignore (multiple occurrences)"
-test_subtest_known_broken
notmuch config set new.ignore .git ignored_file .ignored_hidden_file
notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order.
touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan.