File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -183,10 +183,23 @@ impl HookPaths {
183183 if let ( Some ( mut stdin_handle) , Some ( input) ) =
184184 ( child. stdin . take ( ) , stdin)
185185 {
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) ;
186+ use std:: io:: { ErrorKind , Write } ;
187+
188+ // Write stdin to hook process
189+ // 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+ } ) ;
190203 }
191204
192205 child. wait_with_output ( )
You can’t perform that action at this time.
0 commit comments