Merge pull request #820 from seehuhn/fixes

ldbGenericReplace: correctly handle files with same version but different flags
This commit is contained in:
Jakob Borg 2014-10-10 00:05:25 +02:00
commit 6e670a2499

View File

@ -232,7 +232,8 @@ func ldbGenericReplace(db *leveldb.DB, folder, device []byte, fs []protocol.File
// marked a file as invalid, so handle that too.
var ef protocol.FileInfoTruncated
ef.UnmarshalXDR(dbi.Value())
if fs[fsi].Version > ef.Version || fs[fsi].Version != ef.Version {
if fs[fsi].Version > ef.Version ||
(fs[fsi].Version == ef.Version && fs[fsi].Flags != ef.Flags) {
if lv := ldbInsert(batch, folder, device, newName, fs[fsi]); lv > maxLocalVer {
maxLocalVer = lv
}