summaryrefslogtreecommitdiff
path: root/src/cmd/restore.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-12 09:50:39 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-12 09:55:50 +0200
commit176442eb1554a674dfa291585abd5eb54aa213d8 (patch)
tree6d455346ef8be4e3af6678775273847e6d98128a /src/cmd/restore.rs
parentd848a9587748308421b54ad2e3126f8afc7a3b38 (diff)
downloadobnam2-176442eb1554a674dfa291585abd5eb54aa213d8.tar.gz
fix: backup and restore of symlink
Diffstat (limited to 'src/cmd/restore.rs')
-rw-r--r--src/cmd/restore.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs
index cb42114..147c422 100644
--- a/src/cmd/restore.rs
+++ b/src/cmd/restore.rs
@@ -168,11 +168,9 @@ fn restore_symlink(path: &Path, entry: &FilesystemEntry) -> RestoreResult<()> {
debug!(" mkdir {}", parent.display());
if !parent.exists() {
std::fs::create_dir_all(parent)?;
- {
- symlink(path, entry.symlink_target().unwrap())?;
- }
}
- debug!("restored regular {}", path.display());
+ symlink(entry.symlink_target().unwrap(), path)?;
+ debug!("restored symlink {}", path.display());
Ok(())
}