Files
git/builtin
Elijah Newren b548f0f156 dir: introduce readdir_skip_dot_and_dotdot() helper
Many places in the code were doing
    while ((d = readdir(dir)) != NULL) {
        if (is_dot_or_dotdot(d->d_name))
            continue;
        ...process d...
    }
Introduce a readdir_skip_dot_and_dotdot() helper to make that a one-liner:
    while ((d = readdir_skip_dot_and_dotdot(dir)) != NULL) {
        ...process d...
    }

This helper particularly simplifies checks for empty directories.

Also use this helper in read_cached_dir() so that our statistics are
consistent across platforms.  (In other words, read_cached_dir() should
have been using is_dot_or_dotdot() and skipping such entries, but did
not and left it to treat_path() to detect and mark such entries as
path_none.)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-05-13 08:45:03 +09:00
..
2021-01-06 15:10:49 -08:00
2020-07-30 19:18:06 -07:00
2021-02-25 16:43:29 -08:00
2021-02-05 16:40:45 -08:00
2020-08-11 18:04:11 -07:00
2021-02-17 17:21:40 -08:00
2021-01-06 15:10:49 -08:00
2020-10-16 12:30:45 -07:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-01-06 15:10:49 -08:00
2021-03-13 16:00:09 -08:00
2021-02-17 17:21:40 -08:00
2021-01-05 14:58:29 -08:00
2021-03-13 16:00:09 -08:00
2021-03-13 16:00:09 -08:00
2021-02-22 16:12:43 -08:00
2021-03-13 16:00:09 -08:00
2021-03-13 16:00:09 -08:00
2021-01-06 14:22:24 -08:00
2021-03-13 16:00:09 -08:00
2021-03-13 16:00:09 -08:00
2021-03-13 16:00:09 -08:00
2020-05-13 12:19:18 -07:00
2021-02-25 16:43:33 -08:00
2021-03-19 15:25:38 -07:00
2020-07-30 19:18:06 -07:00
2020-09-02 14:39:25 -07:00
2021-01-25 14:19:19 -08:00
2021-02-25 16:43:32 -08:00
2021-02-25 16:43:32 -08:00
2021-03-13 16:00:09 -08:00
2020-07-30 19:18:06 -07:00
2020-08-11 18:04:11 -07:00