From: David Bremner Date: Mon, 27 Jun 2016 20:43:04 +0000 (+0200) Subject: lib: update cached mtime in notmuch_directory_set_mtime X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=59fed50a82b0a625a7303099675484557fed9d23;p=notmuch.git lib: update cached mtime in notmuch_directory_set_mtime Without this change, the following code fails notmuch_directory_set_mtime(dir, 12345); assert(notmuch_directory_get_mtime(dir) == 12345); --- diff --git a/lib/directory.cc b/lib/directory.cc index a19f7779..5de3319c 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -227,6 +227,9 @@ notmuch_directory_set_mtime (notmuch_directory_t *directory, Xapian::sortable_serialise (mtime)); db->replace_document (directory->document_id, directory->doc); + + directory->mtime = mtime; + } catch (const Xapian::Error &error) { _notmuch_database_log (notmuch, "A Xapian exception occurred setting directory mtime: %s.\n",