summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Germishuys <jacquesg@striata.com>2015-03-12 13:16:09 +0200
committerJacques Germishuys <jacquesg@striata.com>2015-03-16 09:53:27 +0200
commit74c37c2a48756299306bb10e9e546c1627ca289f (patch)
tree33754c0585b084657059fd9cbac98e0920119cd5
parent13de93631664cd6eec3afedabb7145d5562a3e01 (diff)
downloadlibgit2-74c37c2a48756299306bb10e9e546c1627ca289f.tar.gz
Added options to enable patience and minimal diff drivers
-rw-r--r--include/git2/merge.h6
-rw-r--r--src/merge_file.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/merge.h b/include/git2/merge.h
index e971f2d40..d3360a7e0 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -134,6 +134,12 @@ typedef enum {
/** Ignore whitespace at end of line */
GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = (1 << 5),
+
+ /** Use the "patience diff" algorithm */
+ GIT_MERGE_FILE_DIFF_PATIENCE = (1 << 6),
+
+ /** Take extra time to find minimal diff */
+ GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
} git_merge_file_flags_t;
/**
diff --git a/src/merge_file.c b/src/merge_file.c
index 8bb003fe3..6d89b089d 100644
--- a/src/merge_file.c
+++ b/src/merge_file.c
@@ -158,6 +158,12 @@ static int git_merge_file__from_inputs(
if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL)
xmparam.xpp.flags |= XDF_IGNORE_WHITESPACE_AT_EOL;
+ if (options.flags & GIT_MERGE_FILE_DIFF_PATIENCE)
+ xmparam.xpp.flags |= XDF_PATIENCE_DIFF;
+
+ if (options.flags & GIT_MERGE_FILE_DIFF_MINIMAL)
+ xmparam.xpp.flags |= XDF_NEED_MINIMAL;
+
if ((xdl_result = xdl_merge(&ancestor_mmfile, &our_mmfile,
&their_mmfile, &xmparam, &mmbuffer)) < 0) {
giterr_set(GITERR_MERGE, "Failed to merge files.");