@@ -1002,8 +1002,9 @@ static void diff_words_show(struct diff_words_data *diff_words)
10021002 xpp .flags = 0 ;
10031003 /* as only the hunk header will be parsed, we need a 0-context */
10041004 xecfg .ctxlen = 0 ;
1005- xdi_diff_outf (& minus , & plus , fn_out_diff_words_aux , diff_words ,
1006- & xpp , & xecfg );
1005+ if (xdi_diff_outf (& minus , & plus , fn_out_diff_words_aux , diff_words ,
1006+ & xpp , & xecfg ))
1007+ die ("unable to generate word diff" );
10071008 free (minus .ptr );
10081009 free (plus .ptr );
10091010 if (diff_words -> current_plus != diff_words -> plus .text .ptr +
@@ -2400,8 +2401,9 @@ static void builtin_diff(const char *name_a,
24002401 xecfg .ctxlen = strtoul (v , NULL , 10 );
24012402 if (o -> word_diff )
24022403 init_diff_words_data (& ecbdata , o , one , two );
2403- xdi_diff_outf (& mf1 , & mf2 , fn_out_consume , & ecbdata ,
2404- & xpp , & xecfg );
2404+ if (xdi_diff_outf (& mf1 , & mf2 , fn_out_consume , & ecbdata ,
2405+ & xpp , & xecfg ))
2406+ die ("unable to generate diff for %s" , one -> path );
24052407 if (o -> word_diff )
24062408 free_diff_words_data (& ecbdata );
24072409 if (textconv_one )
@@ -2478,8 +2480,9 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
24782480 xpp .flags = o -> xdl_opts ;
24792481 xecfg .ctxlen = o -> context ;
24802482 xecfg .interhunkctxlen = o -> interhunkcontext ;
2481- xdi_diff_outf (& mf1 , & mf2 , diffstat_consume , diffstat ,
2482- & xpp , & xecfg );
2483+ if (xdi_diff_outf (& mf1 , & mf2 , diffstat_consume , diffstat ,
2484+ & xpp , & xecfg ))
2485+ die ("unable to generate diffstat for %s" , one -> path );
24832486 }
24842487
24852488 diff_free_filespec_data (one );
@@ -2525,8 +2528,9 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
25252528 memset (& xecfg , 0 , sizeof (xecfg ));
25262529 xecfg .ctxlen = 1 ; /* at least one context line */
25272530 xpp .flags = 0 ;
2528- xdi_diff_outf (& mf1 , & mf2 , checkdiff_consume , & data ,
2529- & xpp , & xecfg );
2531+ if (xdi_diff_outf (& mf1 , & mf2 , checkdiff_consume , & data ,
2532+ & xpp , & xecfg ))
2533+ die ("unable to generate checkdiff for %s" , one -> path );
25302534
25312535 if (data .ws_rule & WS_BLANK_AT_EOF ) {
25322536 struct emit_callback ecbdata ;
@@ -4425,8 +4429,10 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
44254429 xpp .flags = 0 ;
44264430 xecfg .ctxlen = 3 ;
44274431 xecfg .flags = 0 ;
4428- xdi_diff_outf (& mf1 , & mf2 , patch_id_consume , & data ,
4429- & xpp , & xecfg );
4432+ if (xdi_diff_outf (& mf1 , & mf2 , patch_id_consume , & data ,
4433+ & xpp , & xecfg ))
4434+ return error ("unable to generate patch-id diff for %s" ,
4435+ p -> one -> path );
44304436 }
44314437
44324438 git_SHA1_Final (sha1 , & ctx );
0 commit comments