@@ -1033,8 +1033,9 @@ static void diff_words_show(struct diff_words_data *diff_words)
1033
1033
xpp .flags = 0 ;
1034
1034
/* as only the hunk header will be parsed, we need a 0-context */
1035
1035
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" );
1038
1039
free (minus .ptr );
1039
1040
free (plus .ptr );
1040
1041
if (diff_words -> current_plus != diff_words -> plus .text .ptr +
@@ -2441,8 +2442,9 @@ static void builtin_diff(const char *name_a,
2441
2442
xecfg .ctxlen = strtoul (v , NULL , 10 );
2442
2443
if (o -> word_diff )
2443
2444
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 );
2446
2448
if (o -> word_diff )
2447
2449
free_diff_words_data (& ecbdata );
2448
2450
if (textconv_one )
@@ -2519,8 +2521,9 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
2519
2521
xpp .flags = o -> xdl_opts ;
2520
2522
xecfg .ctxlen = o -> context ;
2521
2523
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 );
2524
2527
}
2525
2528
2526
2529
diff_free_filespec_data (one );
@@ -2566,8 +2569,9 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
2566
2569
memset (& xecfg , 0 , sizeof (xecfg ));
2567
2570
xecfg .ctxlen = 1 ; /* at least one context line */
2568
2571
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 );
2571
2575
2572
2576
if (data .ws_rule & WS_BLANK_AT_EOF ) {
2573
2577
struct emit_callback ecbdata ;
@@ -4508,8 +4512,10 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
4508
4512
xpp .flags = 0 ;
4509
4513
xecfg .ctxlen = 3 ;
4510
4514
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 );
4513
4519
}
4514
4520
4515
4521
git_SHA1_Final (sha1 , & ctx );
0 commit comments