refactor merge flags into xmparam_t
Include the merge level, favor, and style flags into the xmparam_t struct. This removes the bit twiddling with these three values into the one flags parameter. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
cd1d61c44f
commit
560119b9ab
12
ll-merge.c
12
ll-merge.c
@ -63,8 +63,6 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
|
||||
int flag, int marker_size)
|
||||
{
|
||||
xmparam_t xmp;
|
||||
int style = 0;
|
||||
int favor = (flag >> 1) & 03;
|
||||
|
||||
if (buffer_is_binary(orig->ptr, orig->size) ||
|
||||
buffer_is_binary(src1->ptr, src1->size) ||
|
||||
@ -79,15 +77,13 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
|
||||
}
|
||||
|
||||
memset(&xmp, 0, sizeof(xmp));
|
||||
xmp.level = XDL_MERGE_ZEALOUS;
|
||||
xmp.favor= (flag >> 1) & 03;
|
||||
if (git_xmerge_style >= 0)
|
||||
style = git_xmerge_style;
|
||||
xmp.style = git_xmerge_style;
|
||||
if (marker_size > 0)
|
||||
xmp.marker_size = marker_size;
|
||||
return xdl_merge(orig,
|
||||
src1, name1,
|
||||
src2, name2,
|
||||
&xmp, XDL_MERGE_FLAGS(XDL_MERGE_ZEALOUS, style, favor),
|
||||
result);
|
||||
return xdl_merge(orig, src1, name1, src2, name2, &xmp, result);
|
||||
}
|
||||
|
||||
static int ll_union_merge(const struct ll_merge_driver *drv_unused,
|
||||
|
Reference in New Issue
Block a user