aboutsummaryrefslogtreecommitdiff
path: root/ll-merge.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-29 10:59:16 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-30 19:41:44 -0700
commitc236bcd06138bcbc929b86ad1a513635bf4847b2 (patch)
tree4e1b02387bf93c73b7fc487aa417cb0ae1170d57 /ll-merge.c
parentb541248467fa47979a34e3f1c5bbe3308fbdc4d1 (diff)
downloadgit-c236bcd06138bcbc929b86ad1a513635bf4847b2.tar.gz
git-c236bcd06138bcbc929b86ad1a513635bf4847b2.tar.xz
git-merge-recursive: learn to honor merge.conflictstyle
This teaches the low-level ll_xdl_merge() routine to honor merge.conflictstyle configuration variable, so that merge-recursive strategy can show the conflicts in the style of user's choice. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'll-merge.c')
-rw-r--r--ll-merge.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ll-merge.c b/ll-merge.c
index 9837c842a..4a716146f 100644
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -63,6 +63,7 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
int virtual_ancestor)
{
xpparam_t xpp;
+ int style = 0;
if (buffer_is_binary(orig->ptr, orig->size) ||
buffer_is_binary(src1->ptr, src1->size) ||
@@ -77,10 +78,12 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
}
memset(&xpp, 0, sizeof(xpp));
+ if (git_xmerge_style >= 0)
+ style = git_xmerge_style;
return xdl_merge(orig,
src1, name1,
src2, name2,
- &xpp, XDL_MERGE_ZEALOUS,
+ &xpp, XDL_MERGE_ZEALOUS | style,
result);
}
@@ -95,10 +98,15 @@ static int ll_union_merge(const struct ll_merge_driver *drv_unused,
char *src, *dst;
long size;
const int marker_size = 7;
-
- int status = ll_xdl_merge(drv_unused, result, path_unused,
- orig, src1, NULL, src2, NULL,
- virtual_ancestor);
+ int status, saved_style;
+
+ /* We have to force the RCS "merge" style */
+ saved_style = git_xmerge_style;
+ git_xmerge_style = 0;
+ status = ll_xdl_merge(drv_unused, result, path_unused,
+ orig, src1, NULL, src2, NULL,
+ virtual_ancestor);
+ git_xmerge_style = saved_style;
if (status <= 0)
return status;
size = result->size;