Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2023-02-16 21:27:14 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-17 03:21:56 +0300
commite00e56a7df616659c90d107c3d31d362b5dff103 (patch)
tree7631e8a47c5799297c3d4e4de8904ef0a8ff3fe8 /dir-iterator.h
parentd9d677b2d8cc5f70499db04e633ba7a400f64cbf (diff)
dir-iterator: drop unused `DIR_ITERATOR_FOLLOW_SYMLINKS`
The `FOLLOW_SYMLINKS` flag was added to the dir-iterator API in fa1da7d2ee (dir-iterator: add flags parameter to dir_iterator_begin, 2019-07-10) in order to follow symbolic links while traversing through a directory. `FOLLOW_SYMLINKS` gained its first caller in ff7ccc8c9a (clone: use dir-iterator to avoid explicit dir traversal, 2019-07-10), but it was subsequently removed in 6f054f9fb3 (builtin/clone.c: disallow `--local` clones with symlinks, 2022-07-28). Since then, we've held on to the code for `DIR_ITERATOR_FOLLOW_SYMLINKS` in the name of making minimally invasive changes during a security embargo. In fact, we even changed the dir-iterator API in bffc762f87 (dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS, 2023-01-24) without having any non-test callers of that flag. Now that we're past those security embargo(s), let's finalize our cleanup of the `DIR_ITERATOR_FOLLOW_SYMLINKS` code and remove its implementation since there are no remaining callers. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir-iterator.h')
-rw-r--r--dir-iterator.h20
1 files changed, 1 insertions, 19 deletions
diff --git a/dir-iterator.h b/dir-iterator.h
index e3b6ff2800..479e1ec784 100644
--- a/dir-iterator.h
+++ b/dir-iterator.h
@@ -54,24 +54,8 @@
* and ITER_ERROR is returned immediately. In both cases, a meaningful
* warning is emitted. Note: ENOENT errors are always ignored so that
* the API users may remove files during iteration.
- *
- * - DIR_ITERATOR_FOLLOW_SYMLINKS: make dir-iterator follow symlinks.
- * i.e., linked directories' contents will be iterated over and
- * iter->base.st will contain information on the referred files,
- * not the symlinks themselves, which is the default behavior. Broken
- * symlinks are ignored.
- *
- * Note: setting DIR_ITERATOR_FOLLOW_SYMLINKS affects resolving the
- * starting path as well (e.g., attempting to iterate starting at a
- * symbolic link pointing to a directory without FOLLOW_SYMLINKS will
- * result in an error).
- *
- * Warning: circular symlinks are also followed when
- * DIR_ITERATOR_FOLLOW_SYMLINKS is set. The iteration may end up with
- * an ELOOP if they happen and DIR_ITERATOR_PEDANTIC is set.
*/
#define DIR_ITERATOR_PEDANTIC (1 << 0)
-#define DIR_ITERATOR_FOLLOW_SYMLINKS (1 << 1)
struct dir_iterator {
/* The current path: */
@@ -88,9 +72,7 @@ struct dir_iterator {
const char *basename;
/*
- * The result of calling lstat() on path; or stat(), if the
- * DIR_ITERATOR_FOLLOW_SYMLINKS flag was set at
- * dir_iterator's initialization.
+ * The result of calling lstat() on path.
*/
struct stat st;
};