]> git.ipfire.org Git - thirdparty/git.git/commit
dir: add generic "walk all files" helper
authorDerrick Stolee <stolee@gmail.com>
Fri, 12 Sep 2025 10:30:08 +0000 (10:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Sep 2025 15:59:52 +0000 (08:59 -0700)
commit1588e836bb956d14e6cb38e35933ed2749c023b4
tree4da578844afe9c2fd369aaf6db0cdbc56f933108
parenta8077c19131a86fa123c5be2c8b735acdb5dacf4
dir: add generic "walk all files" helper

There is sometimes a need to visit every file within a directory,
recursively. The main example is remove_dir_recursively(), though it has
some extra flags that make it want to iterate over paths in a custom
way. There is also the fill_directory() approach but that involves an
index and a pathspec.

This change adds a new for_each_file_in_dir() method that will be
helpful in the next change.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
dir.h