}
if (hooks) {
+ /* Drop write lock to run hook */
+ status = notmuch_database_reopen (notmuch, NOTMUCH_DATABASE_MODE_READ_ONLY);
+ if (print_status_database ("notmuch new", notmuch, status))
+ return EXIT_FAILURE;
+
ret = notmuch_run_hook (notmuch, "pre-new");
if (ret)
return EXIT_FAILURE;
+
+ /* acquire write lock again */
+ status = notmuch_database_reopen (notmuch, NOTMUCH_DATABASE_MODE_READ_WRITE);
+ if (print_status_database ("notmuch new", notmuch, status))
+ return EXIT_FAILURE;
}
notmuch_exit_if_unmatched_db_uuid (notmuch);
test_expect_equal_file write.expected write.output
test_begin_subtest "pre-new with write access [${config}]"
- test_subtest_known_broken
rm -rf ${HOOK_DIR}
create_write_hook "pre-new" write.expected write.output $HOOK_DIR
NOTMUCH_NEW