We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a75ae8f commit 3efbeacCopy full SHA for 3efbeac
git2-hooks/src/hookspath.rs
@@ -171,16 +171,20 @@ impl HookPaths {
171
.args(args)
172
.current_dir(&self.pwd)
173
.with_no_window()
174
- .stdin(std::process::Stdio::piped())
+ .stdin(if stdin.is_some() {
175
+ std::process::Stdio::piped()
176
+ } else {
177
+ std::process::Stdio::null()
178
+ })
179
.stdout(std::process::Stdio::piped())
180
.stderr(std::process::Stdio::piped())
181
.spawn()?;
182
- if let Some(mut stdin_handle) = child.stdin.take() {
183
+ if let (Some(mut stdin_handle), Some(input)) =
184
+ (child.stdin.take(), stdin)
185
+ {
186
use std::io::Write;
- if let Some(input) = stdin {
- stdin_handle.write_all(input)?;
- }
187
+ stdin_handle.write_all(input)?;
188
drop(stdin_handle);
189
}
190
0 commit comments