use gix_hash::ObjectId;
pub trait Sealed {}
pub type AncestorsIter<Find> = gix_traverse::commit::Simple<Find, fn(&gix_hash::oid) -> bool>;
pub trait ObjectIdExt: Sealed {
fn ancestors<Find>(self, find: Find) -> AncestorsIter<Find>
where
Find: gix_object::Find;
fn attach(self, repo: &crate::Repository) -> crate::Id<'_>;
}
impl Sealed for ObjectId {}
impl ObjectIdExt for ObjectId {
fn ancestors<Find>(self, find: Find) -> AncestorsIter<Find>
where
Find: gix_object::Find,
{
gix_traverse::commit::Simple::new(Some(self), find)
}
fn attach(self, repo: &crate::Repository) -> crate::Id<'_> {
crate::Id::from_id(self, repo)
}
}