pub struct GitCommand { /* private fields */ }Expand description
The repository read by running git.
Implementations§
Source§impl GitCommand
impl GitCommand
Sourcepub fn merge_base(
&self,
root: &Path,
revision: &str,
) -> Result<MergeBase, StoreError>
pub fn merge_base( &self, root: &Path, revision: &str, ) -> Result<MergeBase, StoreError>
The commit where HEAD left revision.
§Errors
revision names no commit, or git fails or cannot be run.
Sourcepub fn spec_files_at(
&self,
root: &Path,
commit: &str,
) -> Result<Files, StoreError>
pub fn spec_files_at( &self, root: &Path, commit: &str, ) -> Result<Files, StoreError>
The files under spec/ that commit holds, by their paths under spec/, leaving out a
path with a component that begins with ., as the reader does.
§Errors
git fails or cannot be run, or answers in a shape the port does not read.
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 branch(&self, root: &Path) -> Result<Option<String>, StoreError>
pub fn branch(&self, root: &Path) -> Result<Option<String>, StoreError>
The current branch’s short name, or none on a detached HEAD.
§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.