2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-25 22:27:35 +00:00

Don't skip subtree on false filter condition when restoring

We still need to descend into subtrees and check if their filter
matches.
This commit is contained in:
Sebastian Schmidt 2015-01-01 14:50:31 +01:00
parent 190b1cdcc7
commit ccada7d89a

View File

@ -51,10 +51,8 @@ func (res *Restorer) to(dir string, tree_id backend.ID) error {
for _, node := range tree { for _, node := range tree {
p := filepath.Join(dir, node.Name) p := filepath.Join(dir, node.Name)
if !res.Filter(p, node) {
continue
}
if res.Filter(p, node) {
err := node.CreateAt(res.ch, p) err := node.CreateAt(res.ch, p)
if err != nil { if err != nil {
err = res.Error(p, node, arrar.Annotate(err, "create node")) err = res.Error(p, node, arrar.Annotate(err, "create node"))
@ -62,6 +60,7 @@ func (res *Restorer) to(dir string, tree_id backend.ID) error {
return err return err
} }
} }
}
if node.Type == "dir" { if node.Type == "dir" {
if node.Subtree == nil { if node.Subtree == nil {