We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
get_git_modified_files
1 parent 599dc82 commit 2139a78Copy full SHA for 2139a78
src/build_helper/src/git.rs
@@ -186,7 +186,10 @@ pub fn get_git_modified_files(
186
let (status, name) = f.trim().split_once(char::is_whitespace).unwrap();
187
if status == "D" {
188
None
189
- } else if Path::new(name).extension().map_or(false, |ext| {
+ } else if Path::new(name).extension().map_or(extensions.is_empty(), |ext| {
190
+ // If there is no extension, we allow the path if `extensions` is empty
191
+ // If there is an extension, we allow it if `extension` is empty or it contains the
192
+ // extension.
193
extensions.is_empty() || extensions.contains(&ext.to_str().unwrap())
194
}) {
195
Some(name.to_owned())
0 commit comments