From 096b2d73cd287f7ea0c065949a263c388a1c6646 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 3 Jan 2016 21:15:02 +0100 Subject: [PATCH] Don't conflict copy conflict copies (fixes #2605) --- lib/model/rwfolder.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/model/rwfolder.go b/lib/model/rwfolder.go index 6d5f0aef8..b3c74be10 100644 --- a/lib/model/rwfolder.go +++ b/lib/model/rwfolder.go @@ -14,6 +14,7 @@ import ( "os" "path/filepath" "sort" + "strings" "time" "github.com/syncthing/syncthing/lib/config" @@ -1493,6 +1494,14 @@ func removeDevice(devices []protocol.DeviceID, device protocol.DeviceID) []proto } func (p *rwFolder) moveForConflict(name string) error { + if strings.Contains(filepath.Base(name), ".sync-conflict-") { + l.Infoln("Conflict for", name, "which is already a conflict copy; not copying again.") + if err := osutil.Remove(name); err != nil && !os.IsNotExist(err) { + return err + } + return nil + } + if p.maxConflicts == 0 { if err := osutil.Remove(name); err != nil && !os.IsNotExist(err) { return err