MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / execute_raw

Function execute_raw

atomic-repository/src/wip.rs:626–652  ·  view source on GitHub ↗
(
    mut command: Command,
    operation: &'static str,
    input: Option<&[u8]>,
)

Source from the content-addressed store, hash-verified

624}
625
626fn execute_raw(
627 mut command: Command,
628 operation: &'static str,
629 input: Option<&[u8]>,
630) -> Result<Output, WipCaptureError> {
631 if let Some(input) = input {
632 let mut child = command
633 .stdin(Stdio::piped())
634 .stdout(Stdio::piped())
635 .stderr(Stdio::piped())
636 .spawn()
637 .map_err(|source| WipCaptureError::CommandIo { operation, source })?;
638 child
639 .stdin
640 .take()
641 .expect("piped Git stdin")
642 .write_all(input)
643 .map_err(|source| WipCaptureError::CommandIo { operation, source })?;
644 return child
645 .wait_with_output()
646 .map_err(|source| WipCaptureError::CommandIo { operation, source });
647 }
648
649 command
650 .output()
651 .map_err(|source| WipCaptureError::CommandIo { operation, source })
652}
653
654fn command_failure(operation: &'static str, output: &Output) -> WipCaptureError {
655 WipCaptureError::GitCommand {

Callers 2

create_recovery_commitFunction · 0.85
run_git_rawFunction · 0.85

Calls 2

spawnMethod · 0.80
outputMethod · 0.45

Tested by

no test coverage detected