1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 07:43:03 +00:00

Merge pull request #5134 from MichaelEischer/better-time-restore-error

restore: improve error if timestamp fails to restore
This commit is contained in:
Michael Eischer 2024-11-30 13:09:33 +01:00 committed by GitHub
commit 8644bb145b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
package fs package fs
import ( import (
"fmt"
"os" "os"
"os/user" "os/user"
"strconv" "strconv"
@ -296,7 +297,7 @@ func nodeRestoreTimestamps(node *restic.Node, path string) error {
mtime := node.ModTime.UnixNano() mtime := node.ModTime.UnixNano()
if err := utimesNano(fixpath(path), atime, mtime, node.Type); err != nil { if err := utimesNano(fixpath(path), atime, mtime, node.Type); err != nil {
return &os.PathError{Op: "UtimesNano", Path: path, Err: err} return fmt.Errorf("failed to restore timestamp of %q: %w", path, err)
} }
return nil return nil
} }