pub struct NativeGitRepository { /* private fields */ }Expand description
Git repository implementation backed by native git CLI commands.
Implementations§
Source§impl NativeGitRepository
impl NativeGitRepository
pub fn open(path: &Path) -> Result<Self, ReleaseError>
Sourcepub fn parse_remote(&self) -> Result<(String, String), ReleaseError>
pub fn parse_remote(&self) -> Result<(String, String), ReleaseError>
Parse owner/repo from a git remote URL.
Trait Implementations§
Source§impl GitRepository for NativeGitRepository
impl GitRepository for NativeGitRepository
Source§fn latest_tag(&self, prefix: &str) -> Result<Option<TagInfo>, ReleaseError>
fn latest_tag(&self, prefix: &str) -> Result<Option<TagInfo>, ReleaseError>
Find the latest semver tag matching the configured prefix.
Source§fn commits_since(&self, from: Option<&str>) -> Result<Vec<Commit>, ReleaseError>
fn commits_since(&self, from: Option<&str>) -> Result<Vec<Commit>, ReleaseError>
List commits between a starting point (exclusive) and HEAD (inclusive).
If
from is None, returns all commits reachable from HEAD.Source§fn create_tag(&self, name: &str, message: &str) -> Result<(), ReleaseError>
fn create_tag(&self, name: &str, message: &str) -> Result<(), ReleaseError>
Create an annotated tag at HEAD.
Source§fn stage_and_commit(
&self,
paths: &[&str],
message: &str,
) -> Result<bool, ReleaseError>
fn stage_and_commit( &self, paths: &[&str], message: &str, ) -> Result<bool, ReleaseError>
Stage files and commit. Returns Ok(false) if nothing to commit.
Source§fn tag_exists(&self, name: &str) -> Result<bool, ReleaseError>
fn tag_exists(&self, name: &str) -> Result<bool, ReleaseError>
Check if a tag exists locally.
Source§fn remote_tag_exists(&self, name: &str) -> Result<bool, ReleaseError>
fn remote_tag_exists(&self, name: &str) -> Result<bool, ReleaseError>
Check if a tag exists on the remote.
List all semver tags matching prefix, sorted by version ascending.
Source§fn commits_between(
&self,
from: Option<&str>,
to: &str,
) -> Result<Vec<Commit>, ReleaseError>
fn commits_between( &self, from: Option<&str>, to: &str, ) -> Result<Vec<Commit>, ReleaseError>
List commits between two refs (exclusive
from, inclusive to).
If from is None, returns all commits reachable from to.Source§fn tag_date(&self, tag_name: &str) -> Result<String, ReleaseError>
fn tag_date(&self, tag_name: &str) -> Result<String, ReleaseError>
Get the date (YYYY-MM-DD) of the commit a tag points to.
Source§fn force_create_tag(
&self,
name: &str,
message: &str,
) -> Result<(), ReleaseError>
fn force_create_tag( &self, name: &str, message: &str, ) -> Result<(), ReleaseError>
Force-create an annotated tag at HEAD, overwriting if it already exists.
Source§fn force_push_tag(&self, name: &str) -> Result<(), ReleaseError>
fn force_push_tag(&self, name: &str) -> Result<(), ReleaseError>
Force-push a tag to the remote, overwriting the remote tag if it exists.
Auto Trait Implementations§
impl Freeze for NativeGitRepository
impl RefUnwindSafe for NativeGitRepository
impl Send for NativeGitRepository
impl Sync for NativeGitRepository
impl Unpin for NativeGitRepository
impl UnwindSafe for NativeGitRepository
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