We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6519c11 + 081cc4b commit 23eb432Copy full SHA for 23eb432
pathspec/util.py
@@ -42,11 +42,18 @@ def iter_tree(root):
42
for parent, _dirs, files in os.walk(root, followlinks=True):
43
# Get parent path relative to root path.
44
parent = os.path.relpath(parent, root)
45
-
+
46
# Check for recursion.
47
real = os.path.realpath(parent)
48
if real in memo:
49
- raise RecursionError(real_path=real, first_path=memo[real], second_path=parent)
+ abspath = os.path.abspath(parent)
50
+ if real != abspath and real in abspath:
51
+ # if real is a parent of current parent
52
+ raise RecursionError(real_path=real, first_path=memo[real], second_path=parent)
53
+ else:
54
+ # not recursion, just a sideways link
55
+ continue
56
57
memo[real] = parent
58
59
# Yield files.
0 commit comments