@@ -1002,8 +1002,9 @@ static void diff_words_show(struct diff_words_data *diff_words)
1002
1002
xpp .flags = 0 ;
1003
1003
/* as only the hunk header will be parsed, we need a 0-context */
1004
1004
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" );
1007
1008
free (minus .ptr );
1008
1009
free (plus .ptr );
1009
1010
if (diff_words -> current_plus != diff_words -> plus .text .ptr +
@@ -2400,8 +2401,9 @@ static void builtin_diff(const char *name_a,
2400
2401
xecfg .ctxlen = strtoul (v , NULL , 10 );
2401
2402
if (o -> word_diff )
2402
2403
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 );
2405
2407
if (o -> word_diff )
2406
2408
free_diff_words_data (& ecbdata );
2407
2409
if (textconv_one )
@@ -2478,8 +2480,9 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
2478
2480
xpp .flags = o -> xdl_opts ;
2479
2481
xecfg .ctxlen = o -> context ;
2480
2482
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 );
2483
2486
}
2484
2487
2485
2488
diff_free_filespec_data (one );
@@ -2525,8 +2528,9 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
2525
2528
memset (& xecfg , 0 , sizeof (xecfg ));
2526
2529
xecfg .ctxlen = 1 ; /* at least one context line */
2527
2530
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 );
2530
2534
2531
2535
if (data .ws_rule & WS_BLANK_AT_EOF ) {
2532
2536
struct emit_callback ecbdata ;
@@ -4425,8 +4429,10 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
4425
4429
xpp .flags = 0 ;
4426
4430
xecfg .ctxlen = 3 ;
4427
4431
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 );
4430
4436
}
4431
4437
4432
4438
git_SHA1_Final (sha1 , & ctx );
0 commit comments