mirror of
https://github.com/restic/restic.git
synced 2025-02-25 23:43:39 +00:00
Better backup parent snapshot search. Part of #513
I look for the newest snapshot that contains all supplied paths to backup.
This commit is contained in:
parent
7572586ded
commit
60c8c90d35
1 changed files with 8 additions and 4 deletions
|
@ -180,11 +180,15 @@ func samePaths(expected, actual []string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(expected) != len(actual) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
for i := range expected {
|
for i := range expected {
|
||||||
if expected[i] != actual[i] {
|
found := false
|
||||||
|
for j := range actual {
|
||||||
|
if expected[i] == actual[j] {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue