summaryrefslogtreecommitdiff
path: root/merge-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-16 21:45:40 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-16 23:45:33 -0800
commit15b4f7a68d8c3c8ee28424415b203f61202d65d1 (patch)
treea580a0e5f784046497a05eae485f1e90154b8bdf /merge-file.c
parent9914cf468941067b4f3deb9c69c11af3f5b45ccc (diff)
downloadgit-15b4f7a68d8c3c8ee28424415b203f61202d65d1.tar.gz
merge-tree: use ll_merge() not xdl_merge()
ll_merge() interface was designed to merge contents under git control while taking per-path attributes into account. Update the three-way merge implementation used by merge-tree to use it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-file.c')
-rw-r--r--merge-file.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/merge-file.c b/merge-file.c
index 5c00c7e1c1..fd34d76e15 100644
--- a/merge-file.c
+++ b/merge-file.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "run-command.h"
#include "xdiff-interface.h"
+#include "ll-merge.h"
#include "blob.h"
static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
@@ -24,16 +25,13 @@ static void free_mmfile(mmfile_t *f)
free(f->ptr);
}
-static void *three_way_filemerge(mmfile_t *base, mmfile_t *our, mmfile_t *their, unsigned long *size)
+static void *three_way_filemerge(const char *path, mmfile_t *base, mmfile_t *our, mmfile_t *their, unsigned long *size)
{
- mmbuffer_t res;
- xmparam_t xmp;
int merge_status;
+ mmbuffer_t res;
- memset(&xmp, 0, sizeof(xmp));
- merge_status = xdl_merge(base, our, ".our", their, ".their",
- &xmp, XDL_MERGE_ZEALOUS, &res);
-
+ merge_status = ll_merge(&res, path, base,
+ our, ".our", their, ".their", 0);
if (merge_status < 0)
return NULL;
@@ -75,7 +73,7 @@ static int generate_common_file(mmfile_t *res, mmfile_t *f1, mmfile_t *f2)
return xdi_diff(f1, f2, &xpp, &xecfg, &ecb);
}
-void *merge_file(struct blob *base, struct blob *our, struct blob *their, unsigned long *size)
+void *merge_file(const char *path, struct blob *base, struct blob *our, struct blob *their, unsigned long *size)
{
void *res = NULL;
mmfile_t f1, f2, common;
@@ -108,7 +106,7 @@ void *merge_file(struct blob *base, struct blob *our, struct blob *their, unsign
if (generate_common_file(&common, &f1, &f2) < 0)
goto out_free_f2_f1;
}
- res = three_way_filemerge(&common, &f1, &f2, size);
+ res = three_way_filemerge(path, &common, &f1, &f2, size);
free_mmfile(&common);
out_free_f2_f1:
free_mmfile(&f2);