Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle/cob: Do not return `BrokenPipe` from external COB invocation
Lorenz Leutgeb committed 1 day ago
commit cc70d7dad40d91175eecf3d3a5e4225775d0110b
parent 553a3eb
1 file changed +3 -8
modified crates/radicle/src/cob/external.rs
@@ -81,7 +81,7 @@
//! [remote helpers]: https://git-scm.com/docs/gitremote-helpers

use std::collections::HashMap;
-
use std::io::{Error as IoError, ErrorKind};
+
use std::io::Error as IoError;
use std::process::{Command, Stdio};

use serde::{Deserialize, Serialize};
@@ -158,17 +158,12 @@ impl External {
            prefix + suffix
        };

-
        let child = Command::new(command_name)
+
        let mut child = Command::new(command_name)
            .stdin(Stdio::piped())
            .stdout(Stdio::piped())
            .spawn()?;

-
        let Some(stdin) = &child.stdin else {
-
            return Err(Error::Io(IoError::new(
-
                ErrorKind::BrokenPipe,
-
                "stdin not available",
-
            )));
-
        };
+
        let stdin = child.stdin.take().expect("handle preset");

        #[derive(Serialize)]
        struct OpMessage {