aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-28 15:33:56 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-28 15:33:56 -0700
commit11a458befcd7662fbe6d2d53c76d49ae2b0fe219 (patch)
treede4cf6a8a43cb30b53f924ed8820de09409f0afd /diff.c
parentee6ad5f4d56e697c972af86cbefdf269b386e470 (diff)
parenta2558fb8e1e387b630312311e1d22c95663da5d0 (diff)
downloadgit-11a458befcd7662fbe6d2d53c76d49ae2b0fe219.tar.gz
git-11a458befcd7662fbe6d2d53c76d49ae2b0fe219.tar.xz
Sync with 2.4.10
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/diff.c b/diff.c
index 0f17ec550..71f0274ce 100644
--- a/diff.c
+++ b/diff.c
@@ -1033,8 +1033,9 @@ static void diff_words_show(struct diff_words_data *diff_words)
xpp.flags = 0;
/* as only the hunk header will be parsed, we need a 0-context */
xecfg.ctxlen = 0;
- xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
- &xpp, &xecfg);
+ if (xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
+ &xpp, &xecfg))
+ die("unable to generate word diff");
free(minus.ptr);
free(plus.ptr);
if (diff_words->current_plus != diff_words->plus.text.ptr +
@@ -2441,8 +2442,9 @@ static void builtin_diff(const char *name_a,
xecfg.ctxlen = strtoul(v, NULL, 10);
if (o->word_diff)
init_diff_words_data(&ecbdata, o, one, two);
- xdi_diff_outf(&mf1, &mf2, fn_out_consume, &ecbdata,
- &xpp, &xecfg);
+ if (xdi_diff_outf(&mf1, &mf2, fn_out_consume, &ecbdata,
+ &xpp, &xecfg))
+ die("unable to generate diff for %s", one->path);
if (o->word_diff)
free_diff_words_data(&ecbdata);
if (textconv_one)
@@ -2519,8 +2521,9 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
xpp.flags = o->xdl_opts;
xecfg.ctxlen = o->context;
xecfg.interhunkctxlen = o->interhunkcontext;
- xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
- &xpp, &xecfg);
+ if (xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
+ &xpp, &xecfg))
+ die("unable to generate diffstat for %s", one->path);
}
diff_free_filespec_data(one);
@@ -2566,8 +2569,9 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 1; /* at least one context line */
xpp.flags = 0;
- xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
- &xpp, &xecfg);
+ if (xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
+ &xpp, &xecfg))
+ die("unable to generate checkdiff for %s", one->path);
if (data.ws_rule & WS_BLANK_AT_EOF) {
struct emit_callback ecbdata;
@@ -4508,8 +4512,10 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
xpp.flags = 0;
xecfg.ctxlen = 3;
xecfg.flags = 0;
- xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
- &xpp, &xecfg);
+ if (xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
+ &xpp, &xecfg))
+ return error("unable to generate patch-id diff for %s",
+ p->one->path);
}
git_SHA1_Final(sha1, &ctx);