From 57ec2ff915f7e5b9218d149bde86cfdd550c3710 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 28 Apr 2015 11:33:54 +0200 Subject: [PATCH] Handle conflict with local delete (fixes #1722) --- internal/model/rwfolder.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/model/rwfolder.go b/internal/model/rwfolder.go index 4b37ef088..d47fe4b82 100644 --- a/internal/model/rwfolder.go +++ b/internal/model/rwfolder.go @@ -1246,5 +1246,13 @@ func moveForConflict(name string) error { ext := filepath.Ext(name) withoutExt := name[:len(name)-len(ext)] newName := withoutExt + time.Now().Format(".sync-conflict-20060102-150405") + ext - return os.Rename(name, newName) + err := os.Rename(name, newName) + if os.IsNotExist(err) { + // We were supposed to move a file away but it does not exist. Either + // the user has already moved it away, or the conflict was between a + // remote modification and a local delete. In either way it does not + // matter, go ahead as if the move succeeded. + return nil + } + return err }