mirror of
https://github.com/restic/restic.git
synced 2025-12-12 05:52:24 +00:00
restore: exclude/include xattrs
For: https://github.com/restic/restic/issues/5089 Signed-off-by: Tesshu Flower <tflower@redhat.com>
This commit is contained in:
@@ -31,6 +31,8 @@ type Restorer struct {
|
||||
// SelectFilter determines whether the item is selectedForRestore or whether a childMayBeSelected.
|
||||
// selectedForRestore must not depend on isDir as `removeUnexpectedFiles` always passes false to isDir.
|
||||
SelectFilter func(item string, isDir bool) (selectedForRestore bool, childMayBeSelected bool)
|
||||
|
||||
XattrSelectFilter func(xattrName string) (xattrSelectedForRestore bool)
|
||||
}
|
||||
|
||||
var restorerAbortOnAllErrors = func(_ string, err error) error { return err }
|
||||
@@ -288,7 +290,7 @@ func (res *Restorer) restoreNodeMetadataTo(node *restic.Node, target, location s
|
||||
return nil
|
||||
}
|
||||
debug.Log("restoreNodeMetadata %v %v %v", node.Name, target, location)
|
||||
err := fs.NodeRestoreMetadata(node, target, res.Warn)
|
||||
err := fs.NodeRestoreMetadata(node, target, res.Warn, res.XattrSelectFilter)
|
||||
if err != nil {
|
||||
debug.Log("node.RestoreMetadata(%s) error %v", target, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user