diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-20 01:54:58 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-20 01:54:59 +0200 |
commit | 33be431c0c7284c1adf0fe49f7838dbc8aee6ea9 (patch) | |
tree | ce7b37182ebe1c89b0d9d4f5ced18e514e60c09d /diff-no-index.c | |
parent | Merge branch 'ab/perl-makefile-cleanup' (diff) | |
parent | dir: introduce readdir_skip_dot_and_dotdot() helper (diff) | |
download | git-33be431c0c7284c1adf0fe49f7838dbc8aee6ea9.tar.xz git-33be431c0c7284c1adf0fe49f7838dbc8aee6ea9.zip |
Merge branch 'en/dir-traversal'
"git clean" and "git ls-files -i" had confusion around working on
or showing ignored paths inside an ignored directory, which has
been corrected.
* en/dir-traversal:
dir: introduce readdir_skip_dot_and_dotdot() helper
dir: update stale description of treat_directory()
dir: traverse into untracked directories if they may have ignored subfiles
dir: avoid unnecessary traversal into ignored directory
t3001, t7300: add testcase showcasing missed directory traversal
t7300: add testcase showing unnecessary traversal into ignored directory
ls-files: error out on -i unless -o or -c are specified
dir: report number of visited directories and paths with trace2
dir: convert trace calls to trace2 equivalents
Diffstat (limited to 'diff-no-index.c')
-rw-r--r-- | diff-no-index.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/diff-no-index.c b/diff-no-index.c index 308922e2b3..9a8b09346b 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -26,9 +26,8 @@ static int read_directory_contents(const char *path, struct string_list *list) if (!(dir = opendir(path))) return error("Could not open directory %s", path); - while ((e = readdir(dir))) - if (!is_dot_or_dotdot(e->d_name)) - string_list_insert(list, e->d_name); + while ((e = readdir_skip_dot_and_dotdot(dir))) + string_list_insert(list, e->d_name); closedir(dir); return 0; |