pub struct GitCommand { /* private fields */ }Expand description
The repository read by running git.
Implementations§
Source§impl GitCommand
impl GitCommand
Sourcepub fn from_command(command: impl Fn() -> Command + 'static) -> Self
pub fn from_command(command: impl Fn() -> Command + 'static) -> Self
Runs the git command that command starts, with the arguments of each call added.
Sourcepub fn prefix(&self, root: &Path) -> Result<String, StoreError>
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.
Sourcepub fn config_get(
&self,
root: &Path,
name: &str,
) -> Result<Option<String>, StoreError>
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.
Sourcepub fn launcher_version(
&self,
root: &Path,
command: &str,
) -> Result<Option<String>, StoreError>
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.
Sourcepub fn config_set(
&self,
root: &Path,
name: &str,
value: &str,
) -> Result<(), StoreError>
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 Repository for GitCommand
impl Repository for GitCommand
Auto Trait Implementations§
impl !RefUnwindSafe for GitCommand
impl !Send for GitCommand
impl !Sync for GitCommand
impl !UnwindSafe for GitCommand
impl Freeze for GitCommand
impl Unpin for GitCommand
impl UnsafeUnpin for GitCommand
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