radicle/cob: Do not return `BrokenPipe` from external COB invocation

A handle for standard input can always be expected here.
This commit is contained in:
Lorenz Leutgeb 2026-04-14 22:42:41 +02:00 committed by Lorenz Leutgeb
parent 553a3ebd0a
commit cc70d7dad4
1 changed files with 3 additions and 8 deletions

View File

@ -81,7 +81,7 @@
//! [remote helpers]: https://git-scm.com/docs/gitremote-helpers //! [remote helpers]: https://git-scm.com/docs/gitremote-helpers
use std::collections::HashMap; use std::collections::HashMap;
use std::io::{Error as IoError, ErrorKind}; use std::io::Error as IoError;
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -158,17 +158,12 @@ impl External {
prefix + suffix prefix + suffix
}; };
let child = Command::new(command_name) let mut child = Command::new(command_name)
.stdin(Stdio::piped()) .stdin(Stdio::piped())
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.spawn()?; .spawn()?;
let Some(stdin) = &child.stdin else { let stdin = child.stdin.take().expect("handle preset");
return Err(Error::Io(IoError::new(
ErrorKind::BrokenPipe,
"stdin not available",
)));
};
#[derive(Serialize)] #[derive(Serialize)]
struct OpMessage { struct OpMessage {