From 80ada1bb6c54ca24cb9a5ef7d7f25b9fe0234b73 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 25 Jun 2020 20:24:31 +0200 Subject: [PATCH] lib/protocol: Don't warn when dropping deleted invalid item (fixes #6795) (#6796) --- lib/protocol/nativemodel_windows.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/protocol/nativemodel_windows.go b/lib/protocol/nativemodel_windows.go index b5159ebda..eb098b0f7 100644 --- a/lib/protocol/nativemodel_windows.go +++ b/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