canonicalize paths before normalization, fix symlink bug
parent
893a87a094
commit
dd16a96125
|
@ -115,7 +115,7 @@ impl UpEndDatabase {
|
||||||
|
|
||||||
let db = UpEndDatabase {
|
let db = UpEndDatabase {
|
||||||
pool,
|
pool,
|
||||||
vault_path: Arc::new(PathBuf::from(dirpath.as_ref())),
|
vault_path: Arc::new(dirpath.as_ref().canonicalize()?),
|
||||||
db_path: Arc::new(upend_path),
|
db_path: Arc::new(upend_path),
|
||||||
};
|
};
|
||||||
let connection = db.connection().unwrap();
|
let connection = db.connection().unwrap();
|
||||||
|
@ -250,7 +250,7 @@ impl UpEndConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn normalize_path(&self, path: &Path) -> Result<PathBuf> {
|
pub fn normalize_path(&self, path: &Path) -> Result<PathBuf> {
|
||||||
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<Option<Entry>> {
|
pub fn retrieve_entry(&self, hash: Hash) -> Result<Option<Entry>> {
|
||||||
|
|
Loading…
Reference in New Issue