X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-insert.c;h=0f272e2e89a1f80a84feb69188b3eb2e121aff10;hb=d12d91f82801d784f49939756ec9643a9cada60c;hp=e483b94905ff653f2e2602283903676bc12d7e91;hpb=f994f0e7df178eb31c656329bb28ffa832ac4364;p=notmuch diff --git a/notmuch-insert.c b/notmuch-insert.c index e483b949..0f272e2e 100644 --- a/notmuch-insert.c +++ b/notmuch-insert.c @@ -481,7 +481,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 +569,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 +594,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);