History

Allow programs to communicate errors by default (#450)

Sebastian Thiel committed 4 years ago

Commit 5a2168e1 parent c1399d11 file · +4 −4Browse files

Showing the changes to git-command/src (1 of 1 file). Show all

Unified · Split

git-command/src/lib.rs+4−4
@@ -91,15 +91,15 @@ mod prepare { · 90 unmodified lines
9191 ///
9292 /// Note that the default IO is configured for typical API usage, that is
9393 ///
94−/// - `stdin` is null
95−/// - `stdout` is captured.
96−/// - `stderr` is null
94+/// - `stdin` is null to prevent blocking unexpectedly on consumption of stdin
95+/// - `stdout` is captured for consumption by the caller
96+/// - `stderr` is inherited to allow the command to provide context to the user
9797 pub fn prepare(cmd: impl Into<OsString>) -> Prepare {
9898 Prepare {
9999 command: cmd.into(),
100100 stdin: std::process::Stdio::null(),
101101 stdout: std::process::Stdio::piped(),
102− stderr: std::process::Stdio::null(),
102+ stderr: std::process::Stdio::inherit(),
103103 args: Vec::new(),
104104 use_shell: false,
105105 }