summaryrefslogtreecommitdiff
path: root/lib/database.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-12-19 13:11:00 -0800
committerCarl Worth <cworth@cworth.org>2010-01-06 10:32:05 -0800
commit154bf7ac677c41168c5c6a982fee3f22350adfef (patch)
tree43123ac6b204ac8c7727d80fc688926b0f2773a4 /lib/database.cc
parent9257622da8ed50502e59adec69e5daa043ef242a (diff)
database: Store directory paths as relative, not absolute.
We were already storing relative mail filenames, so this is consistent with that. Additionally, it means that directory documents remain valid even if the database is relocated within its containing filesystem.
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index f7f9943..0ef59ea 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -86,7 +86,7 @@ typedef struct {
*
* The directory document is indexed with a single prefixed term:
*
- * directory: The directory path (an absolute path)
+ * directory: The directory path (relative to the database path)
*
* and has a single value:
*
@@ -639,6 +639,8 @@ notmuch_database_set_directory_mtime (notmuch_database_t *notmuch,
return NOTMUCH_STATUS_READONLY_DATABASE;
}
+ path = _notmuch_database_relative_path (notmuch, path);
+
db = static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db);
db_path = directory_db_path (path);