From f254859b2db52eb51c6b916d9b322c69c33cce96 Mon Sep 17 00:00:00 2001
From: Daira Hopwood <daira@jacaranda.org>
Date: Tue, 27 Oct 2015 17:09:40 +0000
Subject: [PATCH] Distinguish deletion of directories.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
---
 src/allmydata/frontends/magic_folder.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py
index e6661c9e..96156f60 100644
--- a/src/allmydata/frontends/magic_folder.py
+++ b/src/allmydata/frontends/magic_folder.py
@@ -705,9 +705,12 @@ class Downloader(QueueMixin, WriteFileMixin):
                 #local_last_uploaded_uri = ...
 
             if relpath_u.endswith(u"/"):
-                self._log("mkdir(%r)" % (abspath_u,))
-                d.addCallback(lambda ign: fileutil.make_dirs(abspath_u))
-                d.addCallback(lambda ign: abspath_u)
+                if metadata.get('deleted', False):
+                    self._log("rmdir(%r) ignored" % (abspath_u,))
+                else:
+                    self._log("mkdir(%r)" % (abspath_u,))
+                    d.addCallback(lambda ign: fileutil.make_dirs(abspath_u))
+                    d.addCallback(lambda ign: abspath_u)
             else:
                 d.addCallback(lambda ign: file_node.download_best_version())
                 if metadata.get('deleted', False):
-- 
2.45.2