Skip to content

Commit 6c50434

Browse files
committed
feat: expose find and Either
1 parent 914bf28 commit 6c50434

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gix-traverse/src/commit/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,18 @@ pub struct Info {
6767
pub commit_time: Option<gix_date::SecondsSinceUnixEpoch>,
6868
}
6969

70-
enum Either<'buf, 'cache> {
70+
/// Information about a commit that can be obtained either from a [`gix_object::CommitRefIter`] or
71+
/// a [`gix_commitgraph::file::Commit`].
72+
pub enum Either<'buf, 'cache> {
73+
/// See [`gix_object::CommitRefIter`].
7174
CommitRefIter(gix_object::CommitRefIter<'buf>),
75+
/// See [`gix_commitgraph::file::Commit`].
7276
CachedCommit(gix_commitgraph::file::Commit<'cache>),
7377
}
7478

75-
fn find<'cache, 'buf, Find>(
79+
/// Find information about a commit by either getting it from a [`gix_commitgraph::Graph`], if
80+
/// present, or a [`gix_object::CommitRefIter`] otherwise.
81+
pub fn find<'cache, 'buf, Find>(
7682
cache: Option<&'cache gix_commitgraph::Graph>,
7783
objects: Find,
7884
id: &gix_hash::oid,

0 commit comments

Comments
 (0)