summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-09 00:05:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-09 00:05:39 (GMT)
commit1e2bba92d21d9c72d4a6816c3a98a22779856f9e (patch)
tree94f9729fb9c5ea36d305ffaeac22f9e957998f4d /diff.c
parent6abe9c87c78d4925e12e609f4f26447c6a579b9e (diff)
parentcdcab133ea75e0bd5c2279ce6c5718f4af4d9a03 (diff)
downloadgit-1e2bba92d21d9c72d4a6816c3a98a22779856f9e.zip
git-1e2bba92d21d9c72d4a6816c3a98a22779856f9e.tar.gz
git-1e2bba92d21d9c72d4a6816c3a98a22779856f9e.tar.bz2
Merge branch 'rs/blame'
* rs/blame: blame: use xdi_diff_hunks(), get rid of struct patch add xdi_diff_hunks() for callers that only need hunk lengths Allow alternate "low-level" emit function from xdl_diff Always initialize xpparam_t to 0 blame: inline get_patch()
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index e368fef..1918b73 100644
--- a/diff.c
+++ b/diff.c
@@ -400,6 +400,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
mmfile_t minus, plus;
int i;
+ memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
minus.size = diff_words->minus.text.size;
minus.ptr = xmalloc(minus.size);
@@ -1416,6 +1417,7 @@ static void builtin_diff(const char *name_a,
if (!pe)
pe = diff_funcname_pattern(two);
+ memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
memset(&ecbdata, 0, sizeof(ecbdata));
ecbdata.label_path = lbl;
@@ -1489,6 +1491,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
xdemitconf_t xecfg;
xdemitcb_t ecb;
+ memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
@@ -1535,6 +1538,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
xdemitconf_t xecfg;
xdemitcb_t ecb;
+ memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 1; /* at least one context line */
xpp.flags = XDF_NEED_MINIMAL;
@@ -2958,6 +2962,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
struct diff_filepair *p = q->queue[i];
int len1, len2;
+ memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
if (p->status == 0)
return error("internal diff status error");