*/
if (_entry_in_ignore_list (entry->d_name, state)) {
if (state->debug)
- printf ("(D) add_files_recursive, pass 1: explicitly ignoring %s/%s\n",
+ printf ("(D) add_files, pass 1: explicitly ignoring %s/%s\n",
path, entry->d_name);
continue;
}
/* Ignore files & directories user has configured to be ignored */
if (_entry_in_ignore_list (entry->d_name, state)) {
if (state->debug)
- printf ("(D) add_files_recursive, pass 2: explicitly ignoring %s/%s\n",
- path,
- entry->d_name);
+ printf ("(D) add_files, pass 2: explicitly ignoring %s/%s\n",
+ path, entry->d_name);
continue;
}
notmuch_filenames_get (db_files));
if (state->debug)
- printf ("(D) add_files_recursive, pass 2: queuing passed file %s for deletion from database\n",
+ printf ("(D) add_files, pass 2: queuing passed file %s for deletion from database\n",
absolute);
_filename_list_add (state->removed_files, absolute);
char *absolute = talloc_asprintf (state->removed_directories,
"%s/%s", path, filename);
if (state->debug)
- printf ("(D) add_files_recursive, pass 2: queuing passed directory %s for deletion from database\n",
+ printf ("(D) add_files, pass 2: queuing passed directory %s for deletion from database\n",
absolute);
_filename_list_add (state->removed_directories, absolute);
"%s/%s", path,
notmuch_filenames_get (db_files));
if (state->debug)
- printf ("(D) add_files_recursive, pass 3: queuing leftover file %s for deletion from database\n",
+ printf ("(D) add_files, pass 3: queuing leftover file %s for deletion from database\n",
absolute);
_filename_list_add (state->removed_files, absolute);
notmuch_filenames_get (db_subdirs));
if (state->debug)
- printf ("(D) add_files_recursive, pass 3: queuing leftover directory %s for deletion from database\n",
+ printf ("(D) add_files, pass 3: queuing leftover directory %s for deletion from database\n",
absolute);
_filename_list_add (state->removed_directories, absolute);
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;
}