Fix bug in get_git_modified_files
It was ignoring files without extension.
This commit is contained in:
parent
599dc823c9
commit
2139a783b0
1 changed files with 4 additions and 1 deletions
|
@ -186,7 +186,10 @@ pub fn get_git_modified_files(
|
|||
let (status, name) = f.trim().split_once(char::is_whitespace).unwrap();
|
||||
if status == "D" {
|
||||
None
|
||||
} else if Path::new(name).extension().map_or(false, |ext| {
|
||||
} else if Path::new(name).extension().map_or(extensions.is_empty(), |ext| {
|
||||
// If there is no extension, we allow the path if `extensions` is empty
|
||||
// If there is an extension, we allow it if `extension` is empty or it contains the
|
||||
// extension.
|
||||
extensions.is_empty() || extensions.contains(&ext.to_str().unwrap())
|
||||
}) {
|
||||
Some(name.to_owned())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue