Skip to main content

NativeGitRepository

Struct NativeGitRepository 

Source
pub struct NativeGitRepository { /* private fields */ }
Expand description

Git repository implementation backed by native git CLI commands.

Implementations§

Source§

impl NativeGitRepository

Source

pub fn open(path: &Path) -> Result<Self, ReleaseError>

Source

pub fn parse_remote(&self) -> Result<(String, String), ReleaseError>

Parse owner/repo from a git remote URL.

Trait Implementations§

Source§

impl GitRepository for NativeGitRepository

Source§

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>

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>

Create an annotated tag at HEAD.
Source§

fn push_tag(&self, name: &str) -> Result<(), ReleaseError>

Push a tag to the remote.
Source§

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 push(&self) -> Result<(), ReleaseError>

Push current branch to origin.
Source§

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>

Check if a tag exists on the remote.
Source§

fn all_tags(&self, prefix: &str) -> Result<Vec<TagInfo>, ReleaseError>

List all semver tags matching prefix, sorted by version ascending.
Source§

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>

Get the date (YYYY-MM-DD) of the commit a tag points to.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.