Browse Source

lib/protocol: Don't warn when dropping deleted invalid item (fixes #6795) (#6796)

Simon Frei 5 years ago
parent
commit
80ada1bb6c
1 changed files with 8 additions and 1 deletions
  1. 8 1
      lib/protocol/nativemodel_windows.go

+ 8 - 1
lib/protocol/nativemodel_windows.go

@@ -7,6 +7,7 @@ package protocol
 // Windows uses backslashes as file separator
 
 import (
+	"fmt"
 	"path/filepath"
 	"strings"
 )
@@ -39,7 +40,13 @@ func fixupFiles(files []FileInfo) []FileInfo {
 	var out []FileInfo
 	for i := range files {
 		if strings.Contains(files[i].Name, `\`) {
-			l.Warnf("Dropping index entry for %s, contains invalid path separator", files[i].Name)
+			msg := fmt.Sprintf("Dropping index entry for %s, contains invalid path separator", files[i].Name)
+			if files[i].Deleted {
+				// Dropping a deleted item doesn't have any consequences.
+				l.Debugln(msg)
+			} else {
+				l.Warnln(msg)
+			}
 			if out == nil {
 				// Most incoming updates won't contain anything invalid, so
 				// we delay the allocation and copy to output slice until we