Skip to main content

GitCommand

Struct GitCommand 

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

The repository read by running git.

Implementations§

Source§

impl GitCommand

Source

pub fn from_command(command: impl Fn() -> Command + 'static) -> Self

Runs the git command that command starts, with the arguments of each call added.

Source

pub fn prefix(&self, root: &Path) -> Result<String, StoreError>

The working directory’s path from the repository’s top level.

§Errors

root is not inside a repository, or git fails or cannot be run.

Source

pub fn config_get( &self, root: &Path, name: &str, ) -> Result<Option<String>, StoreError>

A name’s value in the local configuration of the repository that holds root, or none.

§Errors

git fails or cannot be run.

Source

pub fn launcher_version( &self, root: &Path, command: &str, ) -> Result<Option<String>, StoreError>

The first line <command> --version prints when git runs it as it runs a merge driver: through the shell, from the top of the working tree; none when it fails.

§Errors

git cannot be run.

Source

pub fn config_set( &self, root: &Path, name: &str, value: &str, ) -> Result<(), StoreError>

Sets a name in the local configuration of the repository that holds root.

§Errors

git fails or cannot be run.

Trait Implementations§

Source§

impl Default for GitCommand

Source§

fn default() -> Self

Runs the git on the search path.

Source§

impl Repository for GitCommand

Source§

fn state(&self, root: &Path) -> Result<RepoState, StoreError>

The state of the repository that holds the directory root, which holds spec/. Read more

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.