1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

Remove the unused destination path filter to simplify things a little

This commit is contained in:
Seb Patane 2016-11-14 02:59:55 +10:00
parent 190673b24a
commit ff6495d17d
2 changed files with 7 additions and 7 deletions

View file

@ -106,7 +106,7 @@ func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error {
return nil
}
selectExcludeFilter := func(item string, dstpath string, node *restic.Node) bool {
selectExcludeFilter := func(item string, node *restic.Node) bool {
matched, err := filter.List(opts.Exclude, item)
if err != nil {
Warnf("error for exclude pattern: %v", err)
@ -115,7 +115,7 @@ func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error {
return !matched
}
selectIncludeFilter := func(item string, dstpath string, node *restic.Node) bool {
selectIncludeFilter := func(item string, node *restic.Node) bool {
matched, err := filter.List(opts.Include, item)
if err != nil {
Warnf("error for include pattern: %v", err)

View file

@ -16,7 +16,7 @@ type Restorer struct {
sn *Snapshot
Error func(dir string, node *Node, err error) error
SelectFilter func(item string, dstpath string, node *Node) bool
SelectFilter func(item string, node *Node) bool
}
var restorerAbortOnAllErrors = func(str string, node *Node, err error) error { return err }
@ -24,8 +24,9 @@ var restorerAbortOnAllErrors = func(str string, node *Node, err error) error { r
// NewRestorer creates a restorer preloaded with the content from the snapshot id.
func NewRestorer(repo Repository, id ID) (*Restorer, error) {
r := &Restorer{
repo: repo, Error: restorerAbortOnAllErrors,
SelectFilter: func(string, string, *Node) bool { return true },
repo: repo,
Error: restorerAbortOnAllErrors,
SelectFilter: func(string, *Node) bool { return true },
}
var err error
@ -45,8 +46,7 @@ func (res *Restorer) restoreTo(dst string, dir string, treeID ID) error {
}
for _, node := range tree.Nodes {
selectedForRestore := res.SelectFilter(filepath.Join(dir, node.Name),
filepath.Join(dst, dir, node.Name), node)
selectedForRestore := res.SelectFilter(filepath.Join(dir, node.Name), node)
debug.Log("SelectForRestore returned %v", selectedForRestore)
if selectedForRestore {