summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7fb0eaa)
raw | patch | inline | side by side (parent: 7fb0eaa)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jan 2010 05:01:28 +0000 (21:01 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jan 2010 05:33:13 +0000 (21:33 -0800) |
So far we have only needed to be able to pass an option that is generic to
xdiff family of functions to this function. Extend the interface so that
we can give it merge specific parameters.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff family of functions to this function. Extend the interface so that
we can give it merge specific parameters.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge-file.c | patch | blob | history | |
ll-merge.c | patch | blob | history | |
merge-file.c | patch | blob | history | |
rerere.c | patch | blob | history | |
xdiff/xdiff.h | patch | blob | history | |
xdiff/xmerge.c | patch | blob | history |
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index afd2ea7a732460c431328dbd4c0141a49d638244..11c3524a77812700e96fe830c515d5d85823d037 100644 (file)
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
const char *names[3] = { NULL, NULL, NULL };
mmfile_t mmfs[3];
mmbuffer_t result = {NULL, 0};
- xpparam_t xpp = {XDF_NEED_MINIMAL};
+ xmparam_t xmp = {{XDF_NEED_MINIMAL}};
int ret = 0, i = 0, to_stdout = 0;
int merge_level = XDL_MERGE_ZEALOUS_ALNUM;
int merge_style = 0, quiet = 0;
}
ret = xdl_merge(mmfs + 1, mmfs + 0, names[0], mmfs + 2, names[2],
- &xpp, merge_level | merge_style, &result);
+ &xmp, merge_level | merge_style, &result);
for (i = 0; i < 3; i++)
free(mmfs[i].ptr);
diff --git a/ll-merge.c b/ll-merge.c
index f4b0a0737723d879b1ddfea9376f1644bff029c7..be2bf433a97bcff8010cfeff6cdea8e2c23168f2 100644 (file)
--- a/ll-merge.c
+++ b/ll-merge.c
mmfile_t *src2, const char *name2,
int virtual_ancestor)
{
- xpparam_t xpp;
+ xmparam_t xmp;
int style = 0;
if (buffer_is_binary(orig->ptr, orig->size) ||
virtual_ancestor);
}
- memset(&xpp, 0, sizeof(xpp));
+ memset(&xmp, 0, sizeof(xmp));
if (git_xmerge_style >= 0)
style = git_xmerge_style;
return xdl_merge(orig,
src1, name1,
src2, name2,
- &xpp, XDL_MERGE_ZEALOUS | style,
+ &xmp, XDL_MERGE_ZEALOUS | style,
result);
}
diff --git a/merge-file.c b/merge-file.c
index 3120a95f786eadd4cb5d167facc15714904e9665..5c00c7e1c19ea05c665e30bea67ae550558e3411 100644 (file)
--- a/merge-file.c
+++ b/merge-file.c
static void *three_way_filemerge(mmfile_t *base, mmfile_t *our, mmfile_t *their, unsigned long *size)
{
mmbuffer_t res;
- xpparam_t xpp;
+ xmparam_t xmp;
int merge_status;
- memset(&xpp, 0, sizeof(xpp));
+ memset(&xmp, 0, sizeof(xmp));
merge_status = xdl_merge(base, our, ".our", their, ".their",
- &xpp, XDL_MERGE_ZEALOUS, &res);
+ &xmp, XDL_MERGE_ZEALOUS, &res);
if (merge_status < 0)
return NULL;
diff --git a/rerere.c b/rerere.c
index d92990a6bba01c321bb67bd07287772075f6994a..adb069481ce3c253dca4de7eed2a07990a6d61c7 100644 (file)
--- a/rerere.c
+++ b/rerere.c
int ret;
mmfile_t cur, base, other;
mmbuffer_t result = {NULL, 0};
- xpparam_t xpp = {XDF_NEED_MINIMAL};
+ xmparam_t xmp = {{XDF_NEED_MINIMAL}};
if (handle_file(path, NULL, rerere_path(name, "thisimage")) < 0)
return 1;
read_mmfile(&other, rerere_path(name, "postimage")))
return 1;
ret = xdl_merge(&base, &cur, "", &other, "",
- &xpp, XDL_MERGE_ZEALOUS, &result);
+ &xmp, XDL_MERGE_ZEALOUS, &result);
if (!ret) {
FILE *f = fopen(path, "w");
if (!f)
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index 4da052a3fff6768fca05b2f3399c5d87ec1daa2e..b265909c60b900c3d87b439730f2e9fa45812cb8 100644 (file)
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
xdemitconf_t const *xecfg, xdemitcb_t *ecb);
+typedef struct s_xmparam {
+ xpparam_t xpp;
+} xmparam_t;
+
int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
mmfile_t *mf2, const char *name2,
- xpparam_t const *xpp, int level, mmbuffer_t *result);
+ xmparam_t const *xmp, int level, mmbuffer_t *result);
#ifdef __cplusplus
}
diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c
index 1cb65a95166a8cb60af590118f59d78aa4d24b74..5c37b4ed25d215464023e7c56eefc30a76cb208e 100644 (file)
--- a/xdiff/xmerge.c
+++ b/xdiff/xmerge.c
int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
mmfile_t *mf2, const char *name2,
- xpparam_t const *xpp, int flags, mmbuffer_t *result) {
+ xmparam_t const *xmp, int flags, mmbuffer_t *result) {
xdchange_t *xscr1, *xscr2;
xdfenv_t xe1, xe2;
int status;
+ xpparam_t const *xpp = &xmp->xpp;
result->ptr = NULL;
result->size = 0;