tangled
alpha
login
or
join now
ptr.pet
/
faunu
2
fork
atom
nushell on your web browser
nushell
wasm
terminal
2
fork
atom
overview
issues
pulls
pipelines
fix glob recursing on just a single depth
ptr.pet
2 months ago
1c5f862e
80408401
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
+11
-4
1 changed file
expand all
collapse all
unified
split
src
cmd
glob.rs
+11
-4
src/cmd/glob.rs
···
160
160
161
161
// Recursively walk into subdirectories
162
162
if metadata.file_type == VfsFileType::Directory {
163
163
-
// Continue if: recursive pattern, or we haven't reached max depth, or pattern has more components
163
163
+
// Only recurse if:
164
164
+
// 1. Pattern contains ** (recursive wildcard), OR
165
165
+
// 2. Pattern has path separators and we haven't matched all components yet
166
166
+
let has_path_separator = normalized_pattern.contains('/');
167
167
+
let pattern_component_count = if has_path_separator {
168
168
+
normalized_pattern.split('/').count()
169
169
+
} else {
170
170
+
1
171
171
+
};
172
172
+
164
173
let should_recurse = is_recursive
165
165
-
|| current_depth < max_depth
166
166
-
|| (normalized_pattern.contains('/')
167
167
-
&& current_depth < normalized_pattern.split('/').count());
174
174
+
|| (has_path_separator && current_depth + 1 < pattern_component_count);
168
175
169
176
if should_recurse {
170
177
walk_directory(