diff --git a/src/database/mod.rs b/src/database/mod.rs index 7b0c125..3bcdf5f 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -115,7 +115,7 @@ impl UpEndDatabase { let db = UpEndDatabase { pool, - vault_path: Arc::new(PathBuf::from(dirpath.as_ref())), + vault_path: Arc::new(dirpath.as_ref().canonicalize()?), db_path: Arc::new(upend_path), }; let connection = db.connection().unwrap(); @@ -250,7 +250,7 @@ impl UpEndConnection { } pub fn normalize_path(&self, path: &Path) -> Result { - Ok(path.strip_prefix(self.vault_path.as_path())?.to_path_buf()) + Ok(path.canonicalize()?.strip_prefix(self.vault_path.as_path())?.to_path_buf()) } pub fn retrieve_entry(&self, hash: Hash) -> Result> {