]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-new.c
cli: delete directory documents on directory removal
[notmuch] / notmuch-new.c
index 442a2f0ae2886c169881dab4ae9e35bf20f77bec..d45d0af8642a3f2f4815808c91509e5a0145eda6 100644 (file)
@@ -878,17 +878,11 @@ _remove_directory (void *ctx,
            goto DONE;
     }
 
-    /*
-     * XXX: The library does not have a function to remove a directory
-     * document for a path. Usually this doesn't matter except for a
-     * slight waste of space. However, if the directory gets added to
-     * the filesystem again, the old directory document is found with
-     * the old mtime. Reset the directory mtime to avoid problems.
-     */
-    notmuch_directory_set_mtime (directory, 0);
+    status = notmuch_directory_delete (directory);
 
   DONE:
-    notmuch_directory_destroy (directory);
+    if (status)
+       notmuch_directory_destroy (directory);
     return status;
 }