We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2835cc commit c40528eCopy full SHA for c40528e
git-index/src/init.rs
@@ -18,7 +18,7 @@ impl State {
18
Find: for<'a> FnMut(&git_hash::oid, &'a mut Vec<u8>) -> Option<TreeRefIter<'a>>,
19
{
20
let mut buf = Vec::new();
21
- let root = find(tree, &mut buf).expect("couldn't find a tree for given oid");
+ let root = find(tree, &mut buf).ok_or(breadthfirst::Error::NotFound { oid: tree.into() })?;
22
let state = breadthfirst::State::default();
23
let mut delegate = EntryBuilder::new();
24
breadthfirst(root, state, &mut find, &mut delegate)?;
0 commit comments