1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 01:06:39 +00:00

Allow filtering absolute paths

Before, the restorer called the filter function with a relative path,
this prevented anchoring absolute patterns (which just never matched).
Now call the restore function with an absolute virtual path, starting at
the filepath separator.

Closes #834
This commit is contained in:
Alexander Neumann 2017-03-02 14:50:54 +01:00
parent 4f5e9e939b
commit bf97cc7efa

View file

@ -120,7 +120,7 @@ func (res *Restorer) restoreNodeTo(node *Node, dir string, dst string, idx *Hard
// Before an item is created, res.Filter is called.
func (res *Restorer) RestoreTo(dir string) error {
idx := NewHardlinkIndex()
return res.restoreTo(dir, "", *res.sn.Tree, idx)
return res.restoreTo(dir, string(filepath.Separator), *res.sn.Tree, idx)
}
// Snapshot returns the snapshot this restorer is configured to use.