Package org.eclipse.jgit.merge
Class MergeMessageFormatter
java.lang.Object
org.eclipse.jgit.merge.MergeMessageFormatter
Formatter for constructing the commit message for a merge commit.
The format should be the same as C Git does it, for compatibility.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addConflictsMessage
(Iterable<String> conflictingPaths, StringBuilder sb, char commentChar) Construct the merge commit message.formatWithConflicts
(String message, Iterable<String> conflictingPaths, char commentChar) Add section with conflicting paths to merge message.formatWithConflicts
(String message, List<String> conflictingPaths) Deprecated.private static String
-
Constructor Details
-
MergeMessageFormatter
public MergeMessageFormatter()
-
-
Method Details
-
format
Construct the merge commit message.- Parameters:
refsToMerge
- the refs which will be mergedtarget
- the branch ref which will be merged into- Returns:
- merge commit message
-
formatWithConflicts
Deprecated.since 6.1; useformatWithConflicts(String, Iterable, char)
insteadAdd section with conflicting paths to merge message. Lines are prefixed with a hash.- Parameters:
message
- the original merge messageconflictingPaths
- the paths with conflicts- Returns:
- merge message with conflicting paths added
-
formatWithConflicts
public String formatWithConflicts(String message, Iterable<String> conflictingPaths, char commentChar) Add section with conflicting paths to merge message.- Parameters:
message
- the original merge messageconflictingPaths
- the paths with conflictscommentChar
- comment character to use for prefixing the conflict lines- Returns:
- merge message with conflicting paths added
- Since:
- 6.1
-
addConflictsMessage
private static void addConflictsMessage(Iterable<String> conflictingPaths, StringBuilder sb, char commentChar) -
joinNames
-
formatWithConflicts(String, Iterable, char)
instead