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 61951ff commit 6998e42Copy full SHA for 6998e42
1 file changed
git2-hooks/src/hookspath.rs
@@ -183,10 +183,23 @@ impl HookPaths {
183
if let (Some(mut stdin_handle), Some(input)) =
184
(child.stdin.take(), stdin)
185
{
186
- use std::io::Write;
187
- // Ignore broken pipe errors - the hook may exit without reading stdin
188
- let _ = stdin_handle.write_all(input);
189
- drop(stdin_handle);
+ use std::io::{ErrorKind, Write};
+
+ // Write stdin to hook process
+ // Ignore broken pipe - hook may exit early without reading all input
190
+ let _ =
191
+ stdin_handle.write_all(input).inspect_err(|e| {
192
+ match e.kind() {
193
+ ErrorKind::BrokenPipe => {
194
+ log::debug!(
195
+ "Hook closed stdin early"
196
+ );
197
+ }
198
+ _ => log::warn!(
199
+ "Failed to write stdin to hook: {e}"
200
+ ),
201
202
+ });
203
}
204
205
child.wait_with_output()
0 commit comments