pub struct GitBridge { /* private fields */ }Implementations§
Source§impl GitBridge
impl GitBridge
pub fn open(path: &Path) -> Result<Self, GitError>
pub fn repo_root(&self) -> &Path
pub fn blame_file(&self, file_path: &Path) -> Result<Blame<'_>, GitError>
pub fn blame_file_porcelain( &self, file_path: &Path, ) -> Result<Vec<BlameLineInfo>, GitError>
pub fn commit_summary(&self, oid: Oid) -> Option<String>
pub fn get_head_sha(&self) -> Result<String, GitError>
Sourcepub fn detect_and_get_files(
&self,
pathspecs: &[String],
) -> Result<(DiffScope, Vec<FileChange>), GitError>
pub fn detect_and_get_files( &self, pathspecs: &[String], ) -> Result<(DiffScope, Vec<FileChange>), GitError>
Combined detect scope + get files in one call (fast path).
Shows all changes from HEAD to the current working state by default.
Use --staged for staged changes only.
Sourcepub fn get_changed_files(
&self,
scope: &DiffScope,
pathspecs: &[String],
) -> Result<Vec<FileChange>, GitError>
pub fn get_changed_files( &self, scope: &DiffScope, pathspecs: &[String], ) -> Result<Vec<FileChange>, GitError>
Get changed files for a specific scope
pub fn get_staged_files_with_base_ref( &self, base: &str, pathspecs: &[String], ) -> Result<Vec<FileChange>, GitError>
Sourcepub fn resolve_merge_base(
&self,
ref1: &str,
ref2: &str,
) -> Result<String, GitError>
pub fn resolve_merge_base( &self, ref1: &str, ref2: &str, ) -> Result<String, GitError>
Resolve the merge base between two refs
Sourcepub fn is_valid_rev(&self, refspec: &str) -> bool
pub fn is_valid_rev(&self, refspec: &str) -> bool
Check if a string resolves to a valid git revision
Sourcepub fn read_file_at_ref(
&self,
refspec: &str,
file_path: &str,
) -> Result<Option<String>, GitError>
pub fn read_file_at_ref( &self, refspec: &str, file_path: &str, ) -> Result<Option<String>, GitError>
Read file content at a specific git ref (commit SHA, branch, tag, etc.)
Sourcepub fn get_file_commits(
&self,
file_path: &str,
limit: usize,
) -> Result<Vec<CommitInfo>, GitError>
pub fn get_file_commits( &self, file_path: &str, limit: usize, ) -> Result<Vec<CommitInfo>, GitError>
Get commits that modified a specific file, walking history from HEAD. Returns commits in reverse chronological order (newest first).
Sourcepub fn get_file_commits_follow_renames(
&self,
file_path: &str,
limit: usize,
) -> Result<Vec<FileCommitInfo>, GitError>
pub fn get_file_commits_follow_renames( &self, file_path: &str, limit: usize, ) -> Result<Vec<FileCommitInfo>, GitError>
Get commits that modified a specific file, following renames across history.
Like git log --follow: when the tracked path disappears between commits,
compute a diff with rename detection to find the old filename and continue.
Returns commits in reverse chronological order (newest first).
Sourcepub fn get_commit_changed_files(
&self,
sha: &str,
) -> Result<Vec<String>, GitError>
pub fn get_commit_changed_files( &self, sha: &str, ) -> Result<Vec<String>, GitError>
Get all file paths changed in a single commit (vs its parent). Returns file paths from the new side of each delta.
pub fn get_log(&self, limit: usize) -> Result<Vec<CommitInfo>, GitError>
Auto Trait Implementations§
impl !Sync for GitBridge
impl Freeze for GitBridge
impl RefUnwindSafe for GitBridge
impl Send for GitBridge
impl Unpin for GitBridge
impl UnsafeUnpin for GitBridge
impl UnwindSafe for GitBridge
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
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>
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>
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