Skip to content

Commit c279d7e

Browse files
committed
xdl_diff: identify call sites.
This inserts a new function xdi_diff() that currently does not do anything other than calling the underlying xdl_diff() to the callchain of current callers of xdl_diff() function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 792c158 commit c279d7e

File tree

8 files changed

+16
-10
lines changed

8 files changed

+16
-10
lines changed

builtin-blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
542542
state.ret->chunks = NULL;
543543
state.ret->num = 0;
544544

545-
xdl_diff(file_p, file_o, &xpp, &xecfg, &ecb);
545+
xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);
546546

547547
if (state.ret->num) {
548548
struct chunk *chunk;

builtin-rerere.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static int diff_two(const char *file1, const char *label1,
260260
memset(&xecfg, 0, sizeof(xecfg));
261261
xecfg.ctxlen = 3;
262262
ecb.outf = outf;
263-
xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
263+
xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
264264

265265
free(minus.ptr);
266266
free(plus.ptr);

combine-diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void combine_diff(const unsigned char *parent, mmfile_t *result_file,
226226
state.num_parent = num_parent;
227227
state.n = n;
228228

229-
xdl_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
229+
xdi_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
230230
free(parent_file.ptr);
231231

232232
/* Assign line numbers for this parent.

diff.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
439439
ecb.outf = xdiff_outf;
440440
ecb.priv = diff_words;
441441
diff_words->xm.consume = fn_out_diff_words_aux;
442-
xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
442+
xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
443443

444444
free(minus.ptr);
445445
free(plus.ptr);
@@ -1393,7 +1393,7 @@ static void builtin_diff(const char *name_a,
13931393
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
13941394
ecbdata.diff_words =
13951395
xcalloc(1, sizeof(struct diff_words_data));
1396-
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1396+
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
13971397
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
13981398
free_diff_words_data(&ecbdata);
13991399
}
@@ -1446,7 +1446,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
14461446
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
14471447
ecb.outf = xdiff_outf;
14481448
ecb.priv = diffstat;
1449-
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1449+
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
14501450
}
14511451

14521452
free_and_return:
@@ -1486,7 +1486,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
14861486
xpp.flags = XDF_NEED_MINIMAL;
14871487
ecb.outf = xdiff_outf;
14881488
ecb.priv = &data;
1489-
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
1489+
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
14901490
}
14911491
free_and_return:
14921492
diff_free_filespec_data(one);
@@ -2898,7 +2898,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
28982898
xecfg.flags = XDL_EMIT_FUNCNAMES;
28992899
ecb.outf = xdiff_outf;
29002900
ecb.priv = &data;
2901-
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
2901+
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
29022902
}
29032903

29042904
SHA1_Final(sha1, &ctx);

merge-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int generate_common_file(mmfile_t *res, mmfile_t *f1, mmfile_t *f2)
7171
res->size = 0;
7272

7373
ecb.priv = res;
74-
return xdl_diff(f1, f2, &xpp, &xecfg, &ecb);
74+
return xdi_diff(f1, f2, &xpp, &xecfg, &ecb);
7575
}
7676

7777
void *merge_file(struct blob *base, struct blob *our, struct blob *their, unsigned long *size)

merge-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void show_diff(struct merge_list *entry)
119119
if (!dst.ptr)
120120
size = 0;
121121
dst.size = size;
122-
xdl_diff(&src, &dst, &xpp, &xecfg, &ecb);
122+
xdi_diff(&src, &dst, &xpp, &xecfg, &ecb);
123123
free(src.ptr);
124124
free(dst.ptr);
125125
}

xdiff-interface.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf)
103103
return 0;
104104
}
105105

106+
int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *xecb)
107+
{
108+
return xdl_diff(mf1, mf2, xpp, xecfg, xecb);
109+
}
110+
106111
int read_mmfile(mmfile_t *ptr, const char *filename)
107112
{
108113
struct stat st;

xdiff-interface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct xdiff_emit_state {
1313
unsigned long remainder_size;
1414
};
1515

16+
int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb);
1617
int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf);
1718
int parse_hunk_header(char *line, int len,
1819
int *ob, int *on,

0 commit comments

Comments
 (0)