Walk up from `start` to `stop`, expanding a glob pattern at each level.
(pattern: &str, start: &Path, stop: &Path)
| 141 | |
| 142 | /// Walk up from `start` to `stop`, expanding a glob pattern at each level. |
| 143 | fn glob_up(pattern: &str, start: &Path, stop: &Path) -> Vec<PathBuf> { |
| 144 | let mut current = normalize(start); |
| 145 | let stop = normalize(stop); |
| 146 | let mut result = Vec::new(); |
| 147 | loop { |
| 148 | result.extend(expand_glob(pattern, ¤t)); |
| 149 | if current == stop { |
| 150 | break; |
| 151 | } |
| 152 | match current.parent() { |
| 153 | Some(p) if p != current => current = p.to_path_buf(), |
| 154 | _ => break, |
| 155 | } |
| 156 | } |
| 157 | result |
| 158 | } |
| 159 | |
| 160 | fn is_glob_pattern(s: &str) -> bool { |
| 161 | s.contains('*') || s.contains('?') |
no test coverage detected