aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java20
1 files changed, 20 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 cd50cae4fb..c8a9049e6c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
@@ -112,6 +112,8 @@ public class MergeCommand extends GitCommand<MergeResult> {
private String message;
+ private boolean insertChangeId;
+
private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;
/**
@@ -392,6 +394,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
try (Git git = new Git(getRepository())) {
newHeadId = git.commit()
.setReflogComment(refLogMessage.toString())
+ .setInsertChangeId(insertChangeId)
.call().getId();
}
mergeStatus = MergeStatus.MERGED;
@@ -619,6 +622,23 @@ public class MergeCommand extends GitCommand<MergeResult> {
}
/**
+ * If set to true a change id will be inserted into the commit message
+ *
+ * An existing change id is not replaced. An initial change id (I000...)
+ * will be replaced by the change id.
+ *
+ * @param insertChangeId
+ * whether to insert a change id
+ * @return {@code this}
+ * @since 5.0
+ */
+ public MergeCommand setInsertChangeId(boolean insertChangeId) {
+ checkCallable();
+ this.insertChangeId = insertChangeId;
+ return this;
+ }
+
+ /**
* The progress monitor associated with the diff operation. By default, this
* is set to <code>NullProgressMonitor</code>
*