Previously, if passed a filename with a directory that did not exist
in the database, _notmuch_message_remove_filename would needlessly
create that directory document. Fix it so that doesn't happen.
Xapian::TermIterator i, last;
status = _notmuch_database_filename_to_direntry (
- local, message->notmuch, filename, NOTMUCH_FIND_CREATE, &direntry);
- if (status)
+ local, message->notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry);
+ if (status || !direntry)
return status;
/* Unlink this file from its parent directory. */