@@ -505,6 +505,19 @@ static int get_exporter(struct transport *transport,
505505 return start_command (fastexport );
506506}
507507
508+ static void check_helper_status (struct helper_data * data )
509+ {
510+ int pid , status ;
511+
512+ pid = waitpid (data -> helper -> pid , & status , WNOHANG );
513+ if (pid < 0 )
514+ die ("Could not retrieve status of remote helper '%s'" ,
515+ data -> name );
516+ if (pid > 0 && WIFEXITED (status ))
517+ die ("Remote helper '%s' died with %d" ,
518+ data -> name , WEXITSTATUS (status ));
519+ }
520+
508521static int fetch_with_import (struct transport * transport ,
509522 int nr_heads , struct ref * * to_fetch )
510523{
@@ -541,6 +554,7 @@ static int fetch_with_import(struct transport *transport,
541554
542555 if (finish_command (& fastimport ))
543556 die (_ ("error while running fast-import" ));
557+ check_helper_status (data );
544558
545559 /*
546560 * The fast-import stream of a remote helper that advertises
@@ -1160,6 +1174,7 @@ static int push_refs_with_export(struct transport *transport,
11601174
11611175 if (finish_command (& exporter ))
11621176 die (_ ("error while running fast-export" ));
1177+ check_helper_status (data );
11631178 if (push_update_refs_status (data , remote_refs , flags ))
11641179 return 1 ;
11651180
0 commit comments