mirror of
https://github.com/restic/restic.git
synced 2024-12-23 16:26:11 +00:00
fix linter warnings
This commit is contained in:
parent
105261e12e
commit
7f7c995977
1 changed files with 4 additions and 4 deletions
|
@ -303,7 +303,7 @@ func (res *Restorer) RestoreTo(ctx context.Context, dst string) error {
|
||||||
idx.Add(node.Inode, node.DeviceID, location)
|
idx.Add(node.Inode, node.DeviceID, location)
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.withOverwriteCheck(node, target, location, false, func() error {
|
return res.withOverwriteCheck(node, target, false, func() error {
|
||||||
res.progress.AddFile(node.Size)
|
res.progress.AddFile(node.Size)
|
||||||
filerestorer.addFile(location, node.Content, int64(node.Size))
|
filerestorer.addFile(location, node.Content, int64(node.Size))
|
||||||
res.trackFile(location)
|
res.trackFile(location)
|
||||||
|
@ -327,13 +327,13 @@ func (res *Restorer) RestoreTo(ctx context.Context, dst string) error {
|
||||||
visitNode: func(node *restic.Node, target, location string) error {
|
visitNode: func(node *restic.Node, target, location string) error {
|
||||||
debug.Log("second pass, visitNode: restore node %q", location)
|
debug.Log("second pass, visitNode: restore node %q", location)
|
||||||
if node.Type != "file" {
|
if node.Type != "file" {
|
||||||
return res.withOverwriteCheck(node, target, location, false, func() error {
|
return res.withOverwriteCheck(node, target, false, func() error {
|
||||||
return res.restoreNodeTo(ctx, node, target, location)
|
return res.restoreNodeTo(ctx, node, target, location)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if idx.Has(node.Inode, node.DeviceID) && idx.Value(node.Inode, node.DeviceID) != location {
|
if idx.Has(node.Inode, node.DeviceID) && idx.Value(node.Inode, node.DeviceID) != location {
|
||||||
return res.withOverwriteCheck(node, target, location, true, func() error {
|
return res.withOverwriteCheck(node, target, true, func() error {
|
||||||
return res.restoreHardlinkAt(node, filerestorer.targetPath(idx.Value(node.Inode, node.DeviceID)), target, location)
|
return res.restoreHardlinkAt(node, filerestorer.targetPath(idx.Value(node.Inode, node.DeviceID)), target, location)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ func (res *Restorer) hasRestoredFile(location string) bool {
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (res *Restorer) withOverwriteCheck(node *restic.Node, target, location string, isHardlink bool, cb func() error) error {
|
func (res *Restorer) withOverwriteCheck(node *restic.Node, target string, isHardlink bool, cb func() error) error {
|
||||||
overwrite, err := shouldOverwrite(res.overwrite, node, target)
|
overwrite, err := shouldOverwrite(res.overwrite, node, target)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue