@@ -1033,8 +1033,9 @@ static void diff_words_show(struct diff_words_data *diff_words)
10331033 xpp .flags = 0 ;
10341034 /* as only the hunk header will be parsed, we need a 0-context */
10351035 xecfg .ctxlen = 0 ;
1036- xdi_diff_outf (& minus , & plus , fn_out_diff_words_aux , diff_words ,
1037- & xpp , & xecfg );
1036+ if (xdi_diff_outf (& minus , & plus , fn_out_diff_words_aux , diff_words ,
1037+ & xpp , & xecfg ))
1038+ die ("unable to generate word diff" );
10381039 free (minus .ptr );
10391040 free (plus .ptr );
10401041 if (diff_words -> current_plus != diff_words -> plus .text .ptr +
@@ -2441,8 +2442,9 @@ static void builtin_diff(const char *name_a,
24412442 xecfg .ctxlen = strtoul (v , NULL , 10 );
24422443 if (o -> word_diff )
24432444 init_diff_words_data (& ecbdata , o , one , two );
2444- xdi_diff_outf (& mf1 , & mf2 , fn_out_consume , & ecbdata ,
2445- & xpp , & xecfg );
2445+ if (xdi_diff_outf (& mf1 , & mf2 , fn_out_consume , & ecbdata ,
2446+ & xpp , & xecfg ))
2447+ die ("unable to generate diff for %s" , one -> path );
24462448 if (o -> word_diff )
24472449 free_diff_words_data (& ecbdata );
24482450 if (textconv_one )
@@ -2519,8 +2521,9 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
25192521 xpp .flags = o -> xdl_opts ;
25202522 xecfg .ctxlen = o -> context ;
25212523 xecfg .interhunkctxlen = o -> interhunkcontext ;
2522- xdi_diff_outf (& mf1 , & mf2 , diffstat_consume , diffstat ,
2523- & xpp , & xecfg );
2524+ if (xdi_diff_outf (& mf1 , & mf2 , diffstat_consume , diffstat ,
2525+ & xpp , & xecfg ))
2526+ die ("unable to generate diffstat for %s" , one -> path );
25242527 }
25252528
25262529 diff_free_filespec_data (one );
@@ -2566,8 +2569,9 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
25662569 memset (& xecfg , 0 , sizeof (xecfg ));
25672570 xecfg .ctxlen = 1 ; /* at least one context line */
25682571 xpp .flags = 0 ;
2569- xdi_diff_outf (& mf1 , & mf2 , checkdiff_consume , & data ,
2570- & xpp , & xecfg );
2572+ if (xdi_diff_outf (& mf1 , & mf2 , checkdiff_consume , & data ,
2573+ & xpp , & xecfg ))
2574+ die ("unable to generate checkdiff for %s" , one -> path );
25712575
25722576 if (data .ws_rule & WS_BLANK_AT_EOF ) {
25732577 struct emit_callback ecbdata ;
@@ -4508,8 +4512,10 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
45084512 xpp .flags = 0 ;
45094513 xecfg .ctxlen = 3 ;
45104514 xecfg .flags = 0 ;
4511- xdi_diff_outf (& mf1 , & mf2 , patch_id_consume , & data ,
4512- & xpp , & xecfg );
4515+ if (xdi_diff_outf (& mf1 , & mf2 , patch_id_consume , & data ,
4516+ & xpp , & xecfg ))
4517+ return error ("unable to generate patch-id diff for %s" ,
4518+ p -> one -> path );
45134519 }
45144520
45154521 git_SHA1_Final (sha1 , & ctx );
0 commit comments