forked from TrueCloudLab/restic
Restore timestamps for directories earlier
This commit is contained in:
parent
aa5fd9e9bc
commit
1fb8e332ce
1 changed files with 5 additions and 11 deletions
12
restorer.go
12
restorer.go
|
@ -61,20 +61,14 @@ 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
|
|
||||||
// those directories would overwrite the timestamp of the directories they are in.
|
|
||||||
for _, node := range tree.Nodes {
|
|
||||||
if node.Type != "dir" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Restore directory timestamp at the end. If we would do it earlier, restoring files within
|
||||||
|
// the directory would overwrite the timestamp of the directory they are in.
|
||||||
if err := node.RestoreTimestamps(filepath.Join(dst, dir, node.Name)); err != nil {
|
if err := node.RestoreTimestamps(filepath.Join(dst, dir, node.Name)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue