summaryrefslogtreecommitdiffstats
path: root/notmuch-new.c
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2015-09-25 23:48:46 +0300
committerDavid Bremner <david@tethera.net>2015-10-14 07:55:41 -0300
commite26d99dc7b02f33299c281f97a13deaef802bc7a (patch)
tree9b783507b3a2588cbf5bcf0fd6d00f100a55db10 /notmuch-new.c
parent727fcd18c6a3897622582e71a2d71081e3ae40ea (diff)
cli: delete directory documents on directory removal0.21_rc0
There was a problem with the directory documents being left behind when the filesystem directory was removed. This was worked around in [1]. However, that ignored the fact that the directory documents are also still listed by notmuch_directory_get_child_directories() leading to confusing results when running notmuch new. The directory documents are found and queued for removal over and over again. Fix the problem for real by removing the directory documents. This fixes the tests flagged as broken in [2]. The (non-deterministic) hack test from [3] also still passes with this change. [1] commit acd66cdec075312944e527febd46382e54d99367 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3 [3] id:1441445731-4362-1-git-send-email-jani@nikula.org
Diffstat (limited to 'notmuch-new.c')
-rw-r--r--notmuch-new.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index 442a2f0a..d45d0af8 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -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;
}