diff options
author | Jakob Borg <jakob@nym.se> | 2014-06-14 10:55:44 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-06-14 10:55:44 +0200 |
commit | fd736828061a58585406a66e9542c29ec197c74f (patch) | |
tree | 587e33bfbc5f9920286a1713aa038264c635546c | |
parent | 34bd5b9dcf86de9ba7ad03aeab9f5152ab1e19a5 (diff) |
Don't need to sync deletes for nonexistent files
-rw-r--r-- | files/set.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/files/set.go b/files/set.go index 20027bf54b..bcb7048dfc 100644 --- a/files/set.go +++ b/files/set.go @@ -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) } } |