pub struct GitDag { /* private fields */ }
Expand description
GitDag
maintains segmented changelog as an index on the Git commit graph.
This struct provides a “read-only” view for the commit graph. To read other
parts of the git repo, or make changes to the Git commit graph, use a
separate git2::Repository
object.
The dag
part is append-only. It might include vertexes no longer referred
by the git repo. Use ancestors(git_heads())
to get commits referred by
the git repo, and use &
to filter them.
Implementations§
Source§impl GitDag
impl GitDag
Sourcepub fn open(git_dir: &Path, dag_dir: &Path, main_branch: &str) -> Result<Self>
pub fn open(git_dir: &Path, dag_dir: &Path, main_branch: &str) -> Result<Self>
open
a Git repo at git_dir
. Build index at dag_dir
, with specified main_branch
.
Sourcepub fn open_git_repo(
git_repo: &Repository,
dag_dir: &Path,
main_branch: &str,
) -> Result<Self>
pub fn open_git_repo( git_repo: &Repository, dag_dir: &Path, main_branch: &str, ) -> Result<Self>
For an git repo, build index at dag_dir
with specified main_branch
.
Sourcepub fn git_references(&self) -> &BTreeMap<String, Vertex>
pub fn git_references(&self) -> &BTreeMap<String, Vertex>
Get “snapshotted” references.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GitDag
impl !RefUnwindSafe for GitDag
impl Send for GitDag
impl Sync for GitDag
impl Unpin for GitDag
impl !UnwindSafe for GitDag
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more