It makes perfect sense for users to want to pre-create .notmuch,
e.g. to install hooks, so we should handle the case of a .notmuch
directory without an actual xapian database more gracefully.
err = mkdir (notmuch_path, 0755);
if (err) {
err = mkdir (notmuch_path, 0755);
if (err) {
- if (errno == EEXIST) {
- status = NOTMUCH_STATUS_DATABASE_EXISTS;
- talloc_free (notmuch);
- notmuch = NULL;
- } else {
IGNORE_RESULT (asprintf (&message, "Error: Cannot create directory %s: %s.\n",
notmuch_path, strerror (errno)));
status = NOTMUCH_STATUS_FILE_ERROR;
IGNORE_RESULT (asprintf (&message, "Error: Cannot create directory %s: %s.\n",
notmuch_path, strerror (errno)));
status = NOTMUCH_STATUS_FILE_ERROR;
*)
backup_database
test_begin_subtest ".notmuch without xapian/ handled gracefully ($config)"
*)
backup_database
test_begin_subtest ".notmuch without xapian/ handled gracefully ($config)"
- test_subtest_known_broken
rm -r $XAPIAN_PATH
test_expect_success "notmuch new"
restore_database
rm -r $XAPIAN_PATH
test_expect_success "notmuch new"
restore_database