summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2021-04-29 12:58:23 +0200
committerThomas Wolf <thomas.wolf@paranor.ch>2021-05-03 10:59:24 +0200
commite58bf0870e069fc758d1d9c83b83b8ab80929f34 (patch)
treea0baeaec840a4ef043606e5d8bbb8ca647ac2d40
parentf4069bb4ec39b0934ad0952427c2d9d31c76eec9 (diff)
downloadjgit-e58bf0870e069fc758d1d9c83b83b8ab80929f34.tar.gz
jgit-e58bf0870e069fc758d1d9c83b83b8ab80929f34.zip
Add git config for conflict style merge/diff3
Add a constant in ConfigConstants, and a ConflictStyle enum in MergeCommand. Change-Id: Idf8e036b6b6953bec06d6923a39e5ff30c2da562 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java8
2 files changed, 22 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
index c611f915ae..ef56d802c8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
@@ -87,6 +87,20 @@ public class MergeCommand extends GitCommand<MergeResult> {
private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;
/**
+ * Values for the "merge.conflictStyle" git config.
+ *
+ * @since 5.12
+ */
+ public enum ConflictStyle {
+
+ /** "merge" style: only ours/theirs. This is the default. */
+ MERGE,
+
+ /** "diff3" style: ours/base/theirs. */
+ DIFF3
+ }
+
+ /**
* The modes available for fast forward merges corresponding to the
* <code>--ff</code>, <code>--no-ff</code> and <code>--ff-only</code>
* options under <code>branch.&lt;name&gt;.mergeoptions</code>.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
index 03c1ef904c..3e3d9b5694 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
@@ -398,7 +398,15 @@ public final class ConfigConstants {
public static final String CONFIG_KEY_FF = "ff";
/**
+ * The "conflictStyle" key.
+ *
+ * @since 5.12
+ */
+ public static final String CONFIG_KEY_CONFLICTSTYLE = "conflictStyle";
+
+ /**
* The "checkstat" key
+ *
* @since 3.0
*/
public static final String CONFIG_KEY_CHECKSTAT = "checkstat";