mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-24 18:12:48 +03:00
make sure invalid deltas do not break the app
This commit is contained in:
parent
1a2266cff9
commit
15201d9f8d
@ -60,7 +60,12 @@ impl Store {
|
||||
blobs.insert(relative_file_path.to_owned(), deltas);
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!("Could not get blob for {}: {:#}", entry_path.display(), e);
|
||||
log::error!(
|
||||
"{}: could not get blob for {}: {:#}",
|
||||
commit_id,
|
||||
entry_path.display(),
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
git2::TreeWalkResult::Ok
|
||||
@ -68,6 +73,18 @@ impl Store {
|
||||
|
||||
let deltas = blobs
|
||||
.into_iter()
|
||||
.filter(|(path, deltas)| {
|
||||
let is_ok = deltas.is_ok();
|
||||
if !is_ok {
|
||||
log::error!(
|
||||
"{}: could not parse deltas in {}: {:#}",
|
||||
commit_id,
|
||||
path.display(),
|
||||
deltas.as_ref().err().unwrap()
|
||||
);
|
||||
}
|
||||
is_ok
|
||||
})
|
||||
.map(|(path, deltas)| (path.to_str().unwrap().to_owned(), deltas.unwrap()))
|
||||
.collect();
|
||||
Ok(deltas)
|
||||
|
Loading…
Reference in New Issue
Block a user