mirror of
https://github.com/restic/restic.git
synced 2024-12-22 15:57:07 +00:00
repair snapshots: remove irregular files
This commit is contained in:
parent
f44b7cdf8c
commit
012cb06fe9
1 changed files with 4 additions and 0 deletions
|
@ -92,6 +92,10 @@ func runRepairSnapshots(ctx context.Context, gopts GlobalOptions, opts RepairOpt
|
||||||
// - files whose contents are not fully available (-> file will be modified)
|
// - files whose contents are not fully available (-> file will be modified)
|
||||||
rewriter := walker.NewTreeRewriter(walker.RewriteOpts{
|
rewriter := walker.NewTreeRewriter(walker.RewriteOpts{
|
||||||
RewriteNode: func(node *restic.Node, path string) *restic.Node {
|
RewriteNode: func(node *restic.Node, path string) *restic.Node {
|
||||||
|
if node.Type == restic.NodeTypeIrregular || node.Type == restic.NodeTypeInvalid {
|
||||||
|
Verbosef(" file %q: removed node with invalid type %q\n", path, node.Type)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if node.Type != restic.NodeTypeFile {
|
if node.Type != restic.NodeTypeFile {
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue