pub struct GitRepo { /* private fields */ }
Expand description
Represents a Git repository and provides methods for interacting with it.
Implementations§
Source§impl GitRepo
impl GitRepo
Sourcepub fn open_repo(&self) -> Result<Repository, Error>
pub fn open_repo(&self) -> Result<Repository, Error>
Open the repository at the stored path
Sourcepub async fn get_git_info(&self, _config: &Config) -> Result<CommitContext>
pub async fn get_git_info(&self, _config: &Config) -> Result<CommitContext>
Sourcepub fn get_commits_between_with_callback<T, F>(
&self,
from: &str,
to: &str,
callback: F,
) -> Result<Vec<T>>
pub fn get_commits_between_with_callback<T, F>( &self, from: &str, to: &str, callback: F, ) -> Result<Vec<T>>
Sourcepub async fn get_project_metadata(
&self,
changed_files: &[String],
) -> Result<ProjectMetadata>
pub async fn get_project_metadata( &self, changed_files: &[String], ) -> Result<ProjectMetadata>
Sourcepub fn commit_and_verify(&self, message: &str) -> Result<CommitResult>
pub fn commit_and_verify(&self, message: &str) -> Result<CommitResult>
Sourcepub fn commit(&self, message: &str) -> Result<CommitResult>
pub fn commit(&self, message: &str) -> Result<CommitResult>
Sourcepub fn execute_hook(&self, hook_name: &str) -> Result<()>
pub fn execute_hook(&self, hook_name: &str) -> Result<()>
Sourcepub fn is_inside_work_tree() -> Result<bool>
pub fn is_inside_work_tree() -> Result<bool>
Checks if the current directory is inside a Git work tree.
§Returns
A Result containing a boolean indicating if inside a work tree or an error.
Auto Trait Implementations§
impl Freeze for GitRepo
impl RefUnwindSafe for GitRepo
impl Send for GitRepo
impl Sync for GitRepo
impl Unpin for GitRepo
impl UnwindSafe for GitRepo
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