Function branchless::util::run_git [−][src]
#[must_use]pub fn run_git<S: AsRef<str> + Debug>(
out: &mut impl Write,
err: &mut impl Write,
git_executable: &GitExecutable<'_>,
event_tx_id: Option<EventTransactionId>,
args: &[S]
) -> Result<isize>
Run Git in a subprocess, and inform the user.
This is suitable for commands which affect the working copy or should run hooks. We don’t want our process to be responsible for that.
Args:
out
: The output stream to write to.err
: The error stream to write to.git_executable
: The path to thegit
executable on disk.event_tx_id
: The ID of the current event-log transaction, if any.args
: The list of arguments to pass to Git. Should not include the Git executable itself.
Returns: The exit code of Git (non-zero signifies error).