summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-06-14 10:55:44 +0200
committerJakob Borg <jakob@nym.se>2014-06-14 10:55:44 +0200
commitfd736828061a58585406a66e9542c29ec197c74f (patch)
tree587e33bfbc5f9920286a1713aa038264c635546c
parent34bd5b9dcf86de9ba7ad03aeab9f5152ab1e19a5 (diff)
Don't need to sync deletes for nonexistent files
-rw-r--r--files/set.go7
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)
}
}