mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
cli: don't call _entry_in_ignore_list twice in count files debug
Split file ignores in count_files to fixed and user configured in order to not have to call _entry_in_ignore_list twice when debugging is enabled. Minor detail.
This commit is contained in:
parent
f8d5c9b80e
commit
3f5257cec2
1 changed files with 10 additions and 8 deletions
|
@ -738,18 +738,20 @@ count_files (const char *path, int *count, add_files_state_t *state)
|
||||||
entry = fs_entries[i];
|
entry = fs_entries[i];
|
||||||
|
|
||||||
/* Ignore special directories to avoid infinite recursion.
|
/* Ignore special directories to avoid infinite recursion.
|
||||||
* Also ignore the .notmuch directory and files/directories
|
* Also ignore the .notmuch directory.
|
||||||
* the user has configured to be ignored.
|
|
||||||
*/
|
*/
|
||||||
if (strcmp (entry->d_name, ".") == 0 ||
|
if (strcmp (entry->d_name, ".") == 0 ||
|
||||||
strcmp (entry->d_name, "..") == 0 ||
|
strcmp (entry->d_name, "..") == 0 ||
|
||||||
strcmp (entry->d_name, ".notmuch") == 0 ||
|
strcmp (entry->d_name, ".notmuch") == 0)
|
||||||
_entry_in_ignore_list (entry->d_name, state))
|
continue;
|
||||||
{
|
|
||||||
if (state->debug && _entry_in_ignore_list (entry->d_name, state))
|
/* Ignore any files/directories the user has configured to be
|
||||||
|
* ignored
|
||||||
|
*/
|
||||||
|
if (_entry_in_ignore_list (entry->d_name, state)) {
|
||||||
|
if (state->debug)
|
||||||
printf ("(D) count_files: explicitly ignoring %s/%s\n",
|
printf ("(D) count_files: explicitly ignoring %s/%s\n",
|
||||||
path,
|
path, entry->d_name);
|
||||||
entry->d_name);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue