pub struct Git { /* private fields */ }Implementations§
Source§impl Git
impl Git
pub fn new(cwd: impl Into<PathBuf>) -> Self
pub fn is_installed(&self) -> bool
pub fn is_inside_work_tree(&self) -> bool
pub fn repo_root(&self) -> Option<PathBuf>
pub fn commit(&self, message: &str, allow_empty: bool) -> Result<(), Error>
pub fn list_commits( &self, from: Option<&str>, to: &str, ) -> Result<Vec<CommitSummary>, Error>
pub fn latest_tag(&self) -> Result<Option<String>, Error>
pub fn tag_date(&self, tag: &str) -> Result<Option<String>, Error>
pub fn create_tag(&self, name: &str, message: &str) -> Result<(), Error>
pub fn create_signed_tag(&self, name: &str, message: &str) -> Result<(), Error>
pub fn create_branch(&self, name: &str, from: Option<&str>) -> Result<(), Error>
pub fn checkout_branch(&self, name: &str) -> Result<(), Error>
pub fn list_branches(&self) -> Result<Vec<String>, Error>
pub fn rename_branch(&self, old_name: &str, new_name: &str) -> Result<(), Error>
pub fn delete_branch(&self, name: &str, force: bool) -> Result<(), Error>
pub fn fetch(&self, remote: &str) -> Result<(), Error>
pub fn rebase(&self, onto: &str) -> Result<(), Error>
pub fn merge(&self, branch: &str) -> Result<(), Error>
pub fn prune_remote_tracking(&self, remote: &str) -> Result<(), Error>
pub fn is_branch_merged(&self, name: &str) -> Result<bool, Error>
pub fn push_branch(&self, remote: &str, branch: &str) -> Result<(), Error>
pub fn push_tag(&self, remote: &str, tag: &str) -> Result<(), Error>
pub fn stage_path(&self, path: &str) -> Result<(), Error>
pub fn unstage_path(&self, path: &str) -> Result<(), Error>
pub fn list_changes(&self) -> Result<Vec<Change>, Error>
pub fn latest_tag_ancestor_of(&self, rev: &str) -> Result<Option<String>, Error>
Sourcepub fn commits_by_tag(&self, to: &str) -> Result<Vec<TaggedCommits>, Error>
pub fn commits_by_tag(&self, to: &str) -> Result<Vec<TaggedCommits>, Error>
Returns commits grouped by tag boundary, ordered newest-first.
Each entry contains the tag name (or "Unreleased" for the leading
segment) and the commits that fall in that range. The ranges are
computed as half-open intervals (prev_tag, tag] so every commit
appears in exactly one entry.
to is the tip of the walk (usually "HEAD").
pub fn stage_all(&self) -> Result<(), Error>
pub fn unstage_all(&self) -> Result<(), Error>
pub fn stage_paths(&self, paths: &[String]) -> Result<(), Error>
pub fn unstage_paths(&self, paths: &[String]) -> Result<(), Error>
pub fn diff_unstaged(&self, path: &str) -> Result<Option<String>, Error>
pub fn show_unstaged_diff(&self, path: &str) -> Result<String, Error>
pub fn github_web_url(&self) -> Result<Option<String>, Error>
pub fn current_branch(&self) -> Result<String, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Git
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin for Git
impl UnsafeUnpin for Git
impl UnwindSafe for Git
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