sync: add --no-check-dest flag - fixes #3616

This commit is contained in:
Nick Craig-Wood
2019-10-17 17:41:11 +01:00
parent f754d897e5
commit 207474abab
6 changed files with 44 additions and 6 deletions

View File

@@ -1705,11 +1705,14 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str
}
// Find dst object if it exists
dstObj, err := fdst.NewObject(ctx, dstFileName)
if err == fs.ErrorObjectNotFound {
dstObj = nil
} else if err != nil {
return err
var dstObj fs.Object
if !fs.Config.NoCheckDest {
dstObj, err = fdst.NewObject(ctx, dstFileName)
if err == fs.ErrorObjectNotFound {
dstObj = nil
} else if err != nil {
return err
}
}
// Special case for changing case of a file on a case insensitive remote