+ omit sub-dirs in makeListDeleted.

no need to run rm -r for every sub-dir
pull/1/head
Ivan Olexyn 5 years ago
parent 27db1e2890
commit 3c19f1cf97

@ -116,6 +116,23 @@ public class SyncDirectory {
listDeleted = tools.mapMinus(fromA, substractB); listDeleted = tools.mapMinus(fromA, substractB);
Map<String, SyncFile> swap = new HashMap<>();
for (var entry : listDeleted.entrySet()) {
String key = entry.getKey();
String parentKey = entry.getValue().getParent();
if (listDeleted.containsKey(parentKey) || swap.containsKey(parentKey)) {
swap.put(key, listDeleted.get(key));
}
}
listDeleted = tools.mapMinus(listDeleted, swap);
} }
@ -193,11 +210,6 @@ public class SyncDirectory {
this.otherParentFile = new File(otherParentPath); this.otherParentFile = new File(otherParentPath);
} }
} }
@ -298,7 +310,6 @@ public class SyncDirectory {
} }
} }

Loading…
Cancel
Save