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
sourceimpl Git
impl Git
sourcepub fn make<P>(path: Option<P>) -> Result<Self> where
P: AsRef<Path>,
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.
sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Path of this repository
It’s not always the root directory of the repository.
sourcepub fn new_cmd_for_adding_all_files<F, P>(&self, files: Option<F>) -> Command where
F: Iterator<Item = P>,
P: AsRef<Path>,
pub fn new_cmd_for_adding_all_files<F, P>(&self, files: Option<F>) -> Command where
F: Iterator<Item = P>,
P: AsRef<Path>,
sourcepub fn new_cmd_for_committing_all_files_with_a_message<S>(
&self,
msg: S
) -> Command where
S: AsRef<str>,
pub fn new_cmd_for_committing_all_files_with_a_message<S>(
&self,
msg: S
) -> Command where
S: AsRef<str>,
sourcepub fn new_cmd_for_adding_an_annotated_tag_with_a_message<S>(
&self,
tag: &Semver,
msg: S
) -> Command where
S: AsRef<str>,
pub fn new_cmd_for_adding_an_annotated_tag_with_a_message<S>(
&self,
tag: &Semver,
msg: S
) -> Command where
S: AsRef<str>,
sourcepub fn new_cmd_for_pushing_to_a_remote(&self, remote: &Remote) -> Command
pub fn new_cmd_for_pushing_to_a_remote(&self, remote: &Remote) -> Command
sourcepub fn current_branch(&self) -> Result<String>
pub fn current_branch(&self) -> Result<String>
sourcepub fn find_last_version_with_build_metadata<I, S>(
&self,
build_metadata: I
) -> Result<Option<Semver>> where
I: Iterator<Item = Option<S>>,
S: AsRef<str>,
pub fn find_last_version_with_build_metadata<I, S>(
&self,
build_metadata: I
) -> Result<Option<Semver>> where
I: Iterator<Item = Option<S>>,
S: AsRef<str>,
sourcepub fn work_trees(&self) -> Result<HashSet<WorkTree>>
pub fn work_trees(&self) -> Result<HashSet<WorkTree>>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin for Git
impl UnwindSafe for Git
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more