Fixed inode retrieval for single-file backups

This commit is contained in:
Dennis Schwerdel 2017-04-13 14:42:56 +02:00
parent be1b8bac60
commit f7899bb9f3
2 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ This project follows [semantic versioning](http://semver.org).
- [fixed] Ignoring missing backups folder
- [fixed] Fixed problems with uploads from relative repository paths
- [fixed] Fixed finished messages
- [fixed] Fixed inode retrieval for single-file backups
### v0.1.0 (2017-04-11)

View File

@ -325,6 +325,9 @@ impl Repository {
for c in path.as_ref().components() {
if let path::Component::Normal(name) = c {
let name = name.to_string_lossy();
if inodes.is_empty() && inode.file_type != FileType::Directory && inode.name == name {
return Ok(vec![inode]);
}
if let Some(chunks) = inode.children.as_mut().and_then(|c| c.remove(&name as &str)) {
inodes.push(inode);
inode = try!(self.get_inode(&chunks));