summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9914cf4)
raw | patch | inline | side by side (parent: 9914cf4)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jan 2010 05:45:40 +0000 (21:45 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jan 2010 07:45:33 +0000 (23:45 -0800) |
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>
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>
merge-file.c | patch | blob | history | |
merge-tree.c | patch | blob | history |
diff --git a/merge-file.c b/merge-file.c
index 5c00c7e1c19ea05c665e30bea67ae550558e3411..fd34d76e1516b2c944778a11a5670d382f245873 100644 (file)
--- a/merge-file.c
+++ b/merge-file.c
#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)
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;
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);
diff --git a/merge-tree.c b/merge-tree.c
index f01e7c81aebea84b95154c9076af66979e52715f..37b94d976c3c71e67e7b074dc16e9e088f726c57 100644 (file)
--- a/merge-tree.c
+++ b/merge-tree.c
return "removed in remote";
}
-extern void *merge_file(struct blob *, struct blob *, struct blob *, unsigned long *);
+extern void *merge_file(const char *, struct blob *, struct blob *, struct blob *, unsigned long *);
static void *result(struct merge_list *entry, unsigned long *size)
{
their = NULL;
if (entry)
their = entry->blob;
- return merge_file(base, our, their, size);
+ return merge_file(entry->path, base, our, their, size);
}
static void *origin(struct merge_list *entry, unsigned long *size)