lib: Revert needing invalid files (fixes #7608, ref #7476) (#7609)

This commit is contained in:
Simon Frei
2021-04-29 22:01:46 +02:00
committed by GitHub
parent d5141c6d51
commit dd39556759
12 changed files with 251 additions and 154 deletions
+4 -2
View File
@@ -774,8 +774,10 @@ func (t readWriteTransaction) updateLocalNeed(keyBuf, folder, name []byte, add b
}
func Need(global FileVersion, haveLocal bool, localVersion protocol.Vector) bool {
// We never need a file without a valid version.
if global.Version.IsEmpty() {
// We never need an invalid file or a file without a valid version (just
// another way of expressing "invalid", really, until we fix that
// part...).
if global.IsInvalid() || global.Version.IsEmpty() {
return false
}
// We don't need a deleted file if we don't have it.