pub struct Git { /* private fields */ }Expand description
git, run in one directory.
Implementations§
Source§impl Git
impl Git
Sourcepub fn run(&self, args: &[&str]) -> Result<Vec<u8>, GitError>
pub fn run(&self, args: &[&str]) -> Result<Vec<u8>, GitError>
Runs git <args>, returning stdout.
Sourcepub fn run_with_stdin(
&self,
args: &[&str],
input: &[u8],
) -> Result<Vec<u8>, GitError>
pub fn run_with_stdin( &self, args: &[&str], input: &[u8], ) -> Result<Vec<u8>, GitError>
Runs git <args> feeding input on stdin.
Sourcepub fn run_with_index(
&self,
index: &Path,
args: &[&str],
stdin: Option<&[u8]>,
) -> Result<Vec<u8>, GitError>
pub fn run_with_index( &self, index: &Path, args: &[&str], stdin: Option<&[u8]>, ) -> Result<Vec<u8>, GitError>
Runs git <args> with a separate index file, optionally feeding stdin.
Sourcepub fn line(&self, args: &[&str]) -> Result<String, GitError>
pub fn line(&self, args: &[&str]) -> Result<String, GitError>
Runs git <args> and returns stdout as trimmed UTF-8.
Sourcepub fn succeeds(&self, args: &[&str]) -> Result<bool, GitError>
pub fn succeeds(&self, args: &[&str]) -> Result<bool, GitError>
Whether git <args> succeeds (exit 0); errors only if git can’t run.
Sourcepub fn toplevel(&self) -> Result<Option<PathBuf>, GitError>
pub fn toplevel(&self) -> Result<Option<PathBuf>, GitError>
The working tree root containing dir, or None outside a repository.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Git
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin for Git
impl UnsafeUnpin for Git
impl UnwindSafe for Git
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