Don't need to sync deletes for nonexistent files

This commit is contained in:
Jakob Borg 2014-06-14 10:55:44 +02:00
parent 34bd5b9dcf
commit fd73682806

View File

@ -120,7 +120,12 @@ func (m *Set) Need(id uint) []scanner.File {
continue
}
if gk.newerThan(rkID[gk.Name]) {
if rk, ok := rkID[gk.Name]; gk.newerThan(rk) {
if protocol.IsDeleted(gf.File.Flags) && (!ok || protocol.IsDeleted(m.files[rk].File.Flags)) {
// We don't need to delete files we don't have or that are already deleted
continue
}
fs = append(fs, gf.File)
}
}