We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b285097 commit 77ff8aeCopy full SHA for 77ff8ae
git-repository/src/object/tree/mod.rs
@@ -77,12 +77,11 @@ impl<'repo> Tree<'repo> {
77
self,
78
relative_path: impl AsRef<std::path::Path>,
79
) -> Result<Option<git_object::tree::Entry>, find::existing::Error> {
80
- self.lookup_entry(
81
- relative_path
+ self.lookup_entry(relative_path.as_ref().components().map(|c| {
+ git_path::os_str_into_bstr(c.as_os_str())
82
+ .unwrap_or_else(|_| "".into())
83
.as_ref()
- .components()
84
- .map(|c| git_path::os_str_into_bstr(c.as_os_str()).unwrap_or("".into()).as_ref()),
85
- )
+ }))
86
}
87
88
0 commit comments