X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-insert.c;h=cc5aeefc1fc00b907b09e22e4ac17d909d7b20c5;hp=e483b94905ff653f2e2602283903676bc12d7e91;hb=e823d05ae6dc920d4fc9abf774c3d2575d891d7b;hpb=f994f0e7df178eb31c656329bb28ffa832ac4364 diff --git a/notmuch-insert.c b/notmuch-insert.c index e483b949..cc5aeefc 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -444,7 +444,8 @@ add_file (notmuch_database_t *notmuch, const char *path, tag_op_list_t *tag_ops, } int -notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *notmuch, int argc, char *argv[]) +notmuch_insert_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, + int argc, char *argv[]) { notmuch_status_t status, close_status; struct sigaction action; @@ -481,7 +482,6 @@ notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *not notmuch_process_shared_options (argv[0]); - /* XXX TODO replace this use of DATABASE_PATH with something specific to hooks */ db_path = notmuch_config_get (notmuch, NOTMUCH_CONFIG_DATABASE_PATH); if (! db_path) @@ -570,7 +570,7 @@ notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *not status = add_file (notmuch, newpath, tag_ops, synchronize_flags, keep, indexing_cli_choices.opts); /* Commit changes. */ - close_status = notmuch_database_destroy (notmuch); + close_status = notmuch_database_close (notmuch); if (close_status) { /* Hold on to the first error, if any. */ if (! status) @@ -595,9 +595,11 @@ notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *not if (hooks && status == NOTMUCH_STATUS_SUCCESS) { /* Ignore hook failures. */ - notmuch_run_hook (db_path, "post-insert"); + notmuch_run_hook (notmuch, "post-insert"); } + notmuch_database_destroy (notmuch); + talloc_free (local); return status_to_exit (status);