summaryrefslogtreecommitdiff
path: root/object-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-05-19 23:54:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-19 23:54:59 (GMT)
commit33be431c0c7284c1adf0fe49f7838dbc8aee6ea9 (patch)
treece7b37182ebe1c89b0d9d4f5ced18e514e60c09d /object-file.c
parent2e2ed74be03993706d467e4b8e785afeb5f173d9 (diff)
parentb548f0f1568f6b01e55ca69c24d3cb19489f92aa (diff)
downloadgit-33be431c0c7284c1adf0fe49f7838dbc8aee6ea9.zip
git-33be431c0c7284c1adf0fe49f7838dbc8aee6ea9.tar.gz
git-33be431c0c7284c1adf0fe49f7838dbc8aee6ea9.tar.bz2
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 'object-file.c')
-rw-r--r--object-file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/object-file.c b/object-file.c
index 884855b..f233b44 100644
--- a/object-file.c
+++ b/object-file.c
@@ -2350,10 +2350,8 @@ int for_each_file_in_obj_subdir(unsigned int subdir_nr,
strbuf_addch(path, '/');
baselen = path->len;
- while ((de = readdir(dir))) {
+ while ((de = readdir_skip_dot_and_dotdot(dir))) {
size_t namelen;
- if (is_dot_or_dotdot(de->d_name))
- continue;
namelen = strlen(de->d_name);
strbuf_setlen(path, baselen);