[PATCH] lib: update cached mtime in notmuch_directory_set_mtime

David Bremner david at tethera.net
Mon Jun 27 13:43:04 PDT 2016


Without this change, the following code fails

  notmuch_directory_set_mtime(dir, 12345);
  assert(notmuch_directory_get_mtime(dir) == 12345);
---
 lib/directory.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/directory.cc b/lib/directory.cc
index a19f777..5de3319 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",
-- 
2.8.1



More information about the notmuch mailing list