Commit b8e9467a by Edward Thomson

merge: allow custom conflict marker size

Allow for a custom conflict marker size, allowing callers to override
the default size of the "<<<<<<<" and ">>>>>>>" markers in the
conflicted output file.
parent 45f58409
......@@ -162,6 +162,8 @@ typedef enum {
GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
} git_merge_file_flag_t;
#define GIT_MERGE_CONFLICT_MARKER_SIZE 7
/**
* Options for merging a file
*/
......@@ -191,6 +193,10 @@ typedef struct {
/** see `git_merge_file_flag_t` above */
git_merge_file_flag_t flags;
/** The size of conflict markers (eg, "<<<<<<<"). Default is
* GIT_MERGE_CONFLICT_MARKER_SIZE. */
unsigned short marker_size;
} git_merge_file_options;
#define GIT_MERGE_FILE_OPTIONS_VERSION 1
......
......@@ -126,6 +126,8 @@ static int merge_file__xdiff(
if (options.flags & GIT_MERGE_FILE_DIFF_MINIMAL)
xmparam.xpp.flags |= XDF_NEED_MINIMAL;
xmparam.marker_size = options.marker_size;
if ((xdl_result = xdl_merge(&ancestor_mmfile, &our_mmfile,
&their_mmfile, &xmparam, &mmbuffer)) < 0) {
giterr_set(GITERR_MERGE, "failed to merge files");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment