]> git.notmuchmail.org Git - notmuch/commitdiff
lib: update cached mtime in notmuch_directory_set_mtime
authorDavid Bremner <david@tethera.net>
Mon, 27 Jun 2016 20:43:04 +0000 (22:43 +0200)
committerDavid Bremner <david@tethera.net>
Tue, 23 Aug 2016 23:58:46 +0000 (20:58 -0300)
Without this change, the following code fails

  notmuch_directory_set_mtime(dir, 12345);
  assert(notmuch_directory_get_mtime(dir) == 12345);

lib/directory.cc

index a19f7779881d8ff0b8da9c2b02a2a2645568facb..5de3319c47d1457f92da38f00717507e67684d9c 100644 (file)
@@ -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",