From 60c8c90d353a20f49a9d250c5f2402d2138aee87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 9 May 2016 12:42:12 +0200 Subject: [PATCH] Better backup parent snapshot search. Part of #513 I look for the newest snapshot that contains all supplied paths to backup. --- src/cmds/restic/cmd_backup.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cmds/restic/cmd_backup.go b/src/cmds/restic/cmd_backup.go index b32e7af59..99fdfb15d 100644 --- a/src/cmds/restic/cmd_backup.go +++ b/src/cmds/restic/cmd_backup.go @@ -180,11 +180,15 @@ func samePaths(expected, actual []string) bool { return true } - if len(expected) != len(actual) { - return false - } 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 } }