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:
Bert Wesarg
2010-03-01 22:46:26 +01:00
committed by Junio C Hamano
parent cd1d61c44f
commit 560119b9ab
4 changed files with 25 additions and 29 deletions

View File

@ -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,