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.
Tree::get_name
Tree::get_name_bytes
1 parent 23a5340 commit 6316180Copy full SHA for 6316180
src/tree.rs
@@ -165,15 +165,7 @@ impl<'repo> Tree<'repo> {
165
166
/// Lookup a tree entry by its filename
167
pub fn get_name(&self, filename: &str) -> Option<TreeEntry<'_>> {
168
- let filename = CString::new(filename).unwrap();
169
- unsafe {
170
- let ptr = call!(raw::git_tree_entry_byname(&*self.raw(), filename));
171
- if ptr.is_null() {
172
- None
173
- } else {
174
- Some(entry_from_raw_const(ptr))
175
- }
176
+ self.get_name_bytes(filename.as_bytes())
177
}
178
179
/// Lookup a tree entry by its filename, specified as bytes.
0 commit comments