mirror of
https://github.com/restic/restic.git
synced 2025-12-23 11:56:15 +00:00
Restore timestamps for directories earlier
This commit is contained in:
16
restorer.go
16
restorer.go
@@ -61,18 +61,12 @@ func (res *Restorer) restoreTo(dst string, dir string, treeID backend.ID) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore directory timestamps at the end. If we would do it earlier, restoring files within
|
// Restore directory timestamp at the end. If we would do it earlier, restoring files within
|
||||||
// those directories would overwrite the timestamp of the directories they are in.
|
// the directory would overwrite the timestamp of the directory they are in.
|
||||||
for _, node := range tree.Nodes {
|
if err := node.RestoreTimestamps(filepath.Join(dst, dir, node.Name)); err != nil {
|
||||||
if node.Type != "dir" {
|
return err
|
||||||
continue
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if err := node.RestoreTimestamps(filepath.Join(dst, dir, node.Name)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user