From fd736828061a58585406a66e9542c29ec197c74f Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 14 Jun 2014 10:55:44 +0200 Subject: [PATCH] Don't need to sync deletes for nonexistent files --- files/set.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/files/set.go b/files/set.go index 20027bf54..bcb7048df 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) } }