do not return statuses for non utf file names

This commit is contained in:
Nikita Galaiko 2023-04-27 09:52:36 +02:00
parent 175aad9298
commit 617ae58013

View File

@ -93,9 +93,10 @@ impl<'repository> Repository<'repository> {
let files = statuses
.iter()
.map(|entry| {
let path = entry.path().unwrap();
(path.to_string(), FileStatusType::from(entry.status()))
.filter_map(|entry| {
entry
.path()
.map(|path| (path.to_string(), FileStatusType::from(entry.status())))
})
.collect();
@ -117,9 +118,10 @@ impl<'repository> Repository<'repository> {
let files = statuses
.iter()
.map(|entry| {
let path = entry.path().unwrap();
(path.to_string(), FileStatusType::from(entry.status()))
.filter_map(|entry| {
entry
.path()
.map(|path| (path.to_string(), FileStatusType::from(entry.status())))
})
.collect();