Git

Struct Git 

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

§Git

This struct holds a path to some repository. The path does not need to be root directory of that repository.

Implementations§

Source§

impl Git

Source

pub fn make<P>(path: Option<P>) -> Result<Self>
where P: AsRef<Path>,

§Makes new instance

If you don’t provide a path, current directory will be used.

Source

pub fn path(&self) -> &Path

§Path of this repository

It’s not always the root directory of the repository.

Source

pub fn new_cmd_for_adding_all_files<F, P>(&self, files: Option<F>) -> Command
where F: Iterator<Item = P>, P: AsRef<Path>,

§Makes new command for adding all files
Source

pub fn new_cmd_for_committing_all_files_with_a_message<S>( &self, msg: S, ) -> Command
where S: AsRef<str>,

§Makes new command for committing all files with a message
Source

pub fn new_cmd_for_adding_an_annotated_tag_with_a_message<S>( &self, tag: &Semver, msg: S, ) -> Command
where S: AsRef<str>,

§Makes new command for adding an annotated tag with a message
Source

pub fn new_cmd_for_pushing_to_a_remote(&self, remote: &Remote) -> Command

§Makes new command for pushing to a remote
Source

pub fn new_cmd_for_pushing_tags_to_a_remote(&self, remote: &Remote) -> Command

§Makes new command for pushing tags to a remote
Source

pub fn current_branch(&self) -> Result<String>

§Loads current branch
Source

pub fn find_last_version_with_build_metadata<S>( &self, build_metadata: &[Option<S>], ) -> Result<Option<Semver>>
where S: AsRef<str>,

§Finds last version having build metadata in your set
Source

pub fn find_last_versions(&self) -> Result<BTreeMap<Option<String>, Semver>>

§Finds last versions, grouped by build metadata
Source

pub fn remotes(&self) -> Result<Vec<Remote>>

§Loads remotes and sort them
Source

pub fn work_trees(&self) -> Result<HashSet<WorkTree>>

§Loads work trees
Source

pub fn status<F, P>(&self, files: Option<F>) -> Result<HashMap<PathBuf, Status>>
where F: Iterator<Item = P>, P: AsRef<Path>,

§Loads status

Trait Implementations§

Source§

impl Debug for Git

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Git

§

impl RefUnwindSafe for Git

§

impl Send for Git

§

impl Sync for Git

§

impl Unpin for Git

§

impl UnwindSafe for Git

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.