Skip to content

Commit

Permalink
repository(doc): object_id (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 13, 2021
1 parent a19567e commit 329d183
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-repository/src/ext/object_id.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#![allow(missing_docs)]
use git_hash::ObjectId;
use git_traverse::commit::ancestors::{Ancestors, State};

use crate::easy;

pub trait Sealed {}

/// An extension trait to add functionality to [`ObjectId`]s.
pub trait ObjectIdExt: Sealed {
/// Create an iterator over the ancestry of the commits reachable from this id, which must be a commit.
fn ancestors<Find>(self, find: Find) -> Ancestors<Find, fn(&git_hash::oid) -> bool, State>
where
Find: for<'a> FnMut(&git_hash::oid, &'a mut Vec<u8>) -> Option<git_object::CommitRefIter<'a>>;

/// Infuse this object id with an [`easy::Access`].
fn attach<A: easy::Access + Sized>(self, access: &A) -> easy::Oid<'_, A>;
}

Expand Down
1 change: 1 addition & 0 deletions git-traverse/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,6 @@ pub mod ancestors {
}
}
}
// TODO: put this here as a breaking change.
#[doc(inline)]
pub use ancestors::Ancestors;

0 comments on commit 329d183

Please sign in to comment.