Skip to content

Commit c40528e

Browse files
committed
refactor
1 parent b2835cc commit c40528e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-index/src/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl State {
1818
Find: for<'a> FnMut(&git_hash::oid, &'a mut Vec<u8>) -> Option<TreeRefIter<'a>>,
1919
{
2020
let mut buf = Vec::new();
21-
let root = find(tree, &mut buf).expect("couldn't find a tree for given oid");
21+
let root = find(tree, &mut buf).ok_or(breadthfirst::Error::NotFound { oid: tree.into() })?;
2222
let state = breadthfirst::State::default();
2323
let mut delegate = EntryBuilder::new();
2424
breadthfirst(root, state, &mut find, &mut delegate)?;

0 commit comments

Comments
 (0)