From 6e9b4a50875bb08bc0cc7e9a1393ec90d174edd1 Mon Sep 17 00:00:00 2001 From: nishiki Date: Mon, 11 May 2015 20:12:23 +0200 Subject: [PATCH] fix bug in sync --- lib/Sync.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Sync.rb b/lib/Sync.rb index bfb4d88..051a0c2 100644 --- a/lib/Sync.rb +++ b/lib/Sync.rb @@ -71,6 +71,7 @@ module MPW if not @remote.to_s.empty? @local.list.each do |item| + update = true @remote.list.each do |r| # Update item @@ -88,12 +89,14 @@ module MPW end r.delete + update = true + break end end # Remove an old item - if item.last_sync.to_i < @config.last_sync and item.last_edit < @config.last_sync + if not update and item.last_sync.to_i < @config.last_sync and item.last_edit < @config.last_sync item.delete end end