lib: check for writable db in n_m_tags_maildir_flags

The database needs to be writable because the list of stored file
names will change in general.
This commit is contained in:
David Bremner 2022-05-25 07:51:17 -03:00
parent 3f27cce71f
commit 6f749dd24a
2 changed files with 4 additions and 1 deletions

View file

@ -2039,6 +2039,10 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message)
char *to_set, *to_clear;
notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
status = _notmuch_database_ensure_writable (message->notmuch);
if (status)
return status;
_get_maildir_flag_actions (message, &to_set, &to_clear);
for (filenames = notmuch_message_get_filenames (message);

View file

@ -375,7 +375,6 @@ EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "Handle converting tags to maildir flags with closed db"
test_subtest_known_broken
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
notmuch_status_t status;