pub struct CliOps {
pub repo_dir: PathBuf,
pub notes_ref: String,
}Expand description
Git operations implemented by shelling out to the git CLI.
Fields§
§repo_dir: PathBuf§notes_ref: StringImplementations§
Trait Implementations§
Source§impl GitOps for CliOps
impl GitOps for CliOps
Source§fn diff(&self, commit: &str) -> Result<Vec<FileDiff>, GitError>
fn diff(&self, commit: &str) -> Result<Vec<FileDiff>, GitError>
Get the diff for a single commit.
Source§fn note_read(&self, commit: &str) -> Result<Option<String>, GitError>
fn note_read(&self, commit: &str) -> Result<Option<String>, GitError>
Read a git note from the chronicle notes ref.
Source§fn note_write(&self, commit: &str, content: &str) -> Result<(), GitError>
fn note_write(&self, commit: &str, content: &str) -> Result<(), GitError>
Write a git note to the chronicle notes ref (overwrites existing).
Source§fn note_exists(&self, commit: &str) -> Result<bool, GitError>
fn note_exists(&self, commit: &str) -> Result<bool, GitError>
Check if a note exists for a commit.
Source§fn file_at_commit(&self, path: &Path, commit: &str) -> Result<String, GitError>
fn file_at_commit(&self, path: &Path, commit: &str) -> Result<String, GitError>
Read a file at a specific commit.
Source§fn commit_info(&self, commit: &str) -> Result<CommitInfo, GitError>
fn commit_info(&self, commit: &str) -> Result<CommitInfo, GitError>
Get commit metadata.
Source§fn resolve_ref(&self, refspec: &str) -> Result<String, GitError>
fn resolve_ref(&self, refspec: &str) -> Result<String, GitError>
Resolve a ref (branch name, HEAD, etc.) to a SHA.
Auto Trait Implementations§
impl Freeze for CliOps
impl RefUnwindSafe for CliOps
impl Send for CliOps
impl Sync for CliOps
impl Unpin for CliOps
impl UnsafeUnpin for CliOps
impl UnwindSafe for CliOps
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