Skip to content

Commit 79c2255

Browse files
committed
rename!: Tree::lookup_path() -> Tree::lookup_entry(). (#470)
1 parent 15a18e4 commit 79c2255

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

git-repository/src/object/tree/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'repo> Tree<'repo> {
3131
/// Searching tree entries is currently done in sequence, which allows to the search to be allocation free. It would be possible
3232
/// to re-use a vector and use a binary search instead, which might be able to improve performance over all.
3333
/// However, a benchmark should be created first to have some data and see which trade-off to choose here.
34-
pub fn lookup_path<I, P>(mut self, path: I) -> Result<Option<git_object::tree::Entry>, find::existing::Error>
34+
pub fn lookup_entry<I, P>(mut self, path: I) -> Result<Option<git_object::tree::Entry>, find::existing::Error>
3535
where
3636
I: IntoIterator<Item = P>,
3737
P: PartialEq<BStr>,
@@ -67,11 +67,11 @@ impl<'repo> Tree<'repo> {
6767
///
6868
/// If any path component contains illformed UTF-8 and thus can't be converted to bytes on platforms which can't do so natively,
6969
/// the returned component will be empty which makes the lookup fail.
70-
pub fn lookup_path_by_path(
70+
pub fn lookup_entry_by_path(
7171
self,
7272
relative_path: impl AsRef<std::path::Path>,
7373
) -> Result<Option<git_object::tree::Entry>, find::existing::Error> {
74-
self.lookup_path(
74+
self.lookup_entry(
7575
relative_path
7676
.as_ref()
7777
.components()

git-repository/src/repository/snapshots.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl crate::Repository {
4242
self.head().ok().and_then(|mut head| {
4343
let commit = head.peel_to_commit_in_place().ok()?;
4444
let tree = commit.tree().ok()?;
45-
tree.lookup_path(Some(".mailmap")).ok()?.map(|e| e.oid)
45+
tree.lookup_entry(Some(".mailmap")).ok()?.map(|e| e.oid)
4646
})
4747
});
4848
}

git-repository/src/revision/spec/parse/delegate/navigate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'repo> delegate::Navigate for Delegate<'repo> {
125125
}
126126
let tree = repo.find_object(tree_id)?.into_tree();
127127
let entry =
128-
tree.lookup_path_by_path(git_path::from_bstr(path))?
128+
tree.lookup_entry_by_path(git_path::from_bstr(path))?
129129
.ok_or_else(|| Error::PathNotFound {
130130
path: path.into(),
131131
object: obj.attach(repo).shorten_or_id(),

0 commit comments

Comments
 (0)