canonicalize paths before normalization, fix symlink bug
This commit is contained in:
parent
893a87a094
commit
dd16a96125
1 changed files with 2 additions and 2 deletions
|
@ -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<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>> {
|
||||
|
|
Loading…
Reference in a new issue