aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java5
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java26
4 files changed, 25 insertions, 14 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java
index f4f0ecd689..0d38197d9a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java
@@ -175,7 +175,8 @@ public class CherryPickCommandTest extends RepositoryTestCase {
assertEquals(CherryPickStatus.CONFLICTING, result.getStatus());
assertTrue(new File(db.getDirectory(), Constants.MERGE_MSG).exists());
- assertEquals("side\n\nConflicts:\n\ta\n", db.readMergeCommitMsg());
+ assertEquals("side\n\n# Conflicts:\n#\ta\n",
+ db.readMergeCommitMsg());
assertTrue(new File(db.getDirectory(), Constants.CHERRY_PICK_HEAD)
.exists());
assertEquals(sideCommit.getId(), db.readCherryPickHead());
@@ -207,7 +208,7 @@ public class CherryPickCommandTest extends RepositoryTestCase {
String expected = "<<<<<<< master\na(master)\n=======\na(side)\n>>>>>>> 527460a side\n";
assertEquals(expected, read("a"));
assertTrue(new File(db.getDirectory(), Constants.MERGE_MSG).exists());
- assertEquals("side\n\nConflicts:\n\ta\n", db.readMergeCommitMsg());
+ assertEquals("side\n\n# Conflicts:\n#\ta\n", db.readMergeCommitMsg());
assertFalse(new File(db.getDirectory(), Constants.CHERRY_PICK_HEAD)
.exists());
assertEquals(RepositoryState.SAFE, db.getRepositoryState());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
index 127c404230..64475f5d50 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
@@ -554,7 +554,7 @@ public class MergeCommandTest extends RepositoryTestCase {
git.merge().include(sideBranch)
.setStrategy(MergeStrategy.RESOLVE).call();
- assertEquals("Merge branch 'side'\n\nConflicts:\n\ta\n",
+ assertEquals("Merge branch 'side'\n\n# Conflicts:\n#\ta\n",
db.readMergeCommitMsg());
}
@@ -1787,7 +1787,7 @@ public class MergeCommandTest extends RepositoryTestCase {
+ dateFormatter.formatDate(third
.getAuthorIdent()) + "\n\n\tthird commit\n",
db.readSquashCommitMsg());
- assertEquals("\nConflicts:\n\tfile2\n", db.readMergeCommitMsg());
+ assertEquals("\n# Conflicts:\n#\tfile2\n", db.readMergeCommitMsg());
Status stat = git.status().call();
assertEquals(Sets.of("file2"), stat.getConflicting());
@@ -2013,7 +2013,7 @@ public class MergeCommandTest extends RepositoryTestCase {
git.merge().include(sideBranch).setStrategy(MergeStrategy.RESOLVE)
.setMessage("user message").call();
- assertEquals("user message\n\nConflicts:\n\ta\n",
+ assertEquals("user message\n\n# Conflicts:\n#\ta\n",
db.readMergeCommitMsg());
}
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java
index cfa8486ac5..d833f12d26 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java
@@ -232,7 +232,7 @@ public class RevertCommandTest extends RepositoryTestCase {
assertTrue(new File(db.getDirectory(), Constants.MERGE_MSG).exists());
assertEquals("Revert \"" + sideCommit.getShortMessage()
+ "\"\n\nThis reverts commit " + sideCommit.getId().getName()
- + ".\n\nConflicts:\n\ta\n",
+ + ".\n\n# Conflicts:\n#\ta\n",
db.readMergeCommitMsg());
assertTrue(new File(db.getDirectory(), Constants.REVERT_HEAD)
.exists());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java
index dedb56c7b0..a2576cc677 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java
@@ -13,6 +13,7 @@ import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.Arrays;
+import java.util.List;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdRef;
@@ -157,8 +158,8 @@ public class MergeMessageFormatterTest extends SampleDataRepositoryTestCase {
public void testFormatWithConflictsNoFooter() {
String originalMessage = "Header Line\n\nCommit body\n";
String message = formatter.formatWithConflicts(originalMessage,
- Arrays.asList(new String[] { "path1" }));
- assertEquals("Header Line\n\nCommit body\n\nConflicts:\n\tpath1\n",
+ List.of("path1"), '#');
+ assertEquals("Header Line\n\nCommit body\n\n# Conflicts:\n#\tpath1\n",
message);
}
@@ -166,8 +167,17 @@ public class MergeMessageFormatterTest extends SampleDataRepositoryTestCase {
public void testFormatWithConflictsNoFooterNoLineBreak() {
String originalMessage = "Header Line\n\nCommit body";
String message = formatter.formatWithConflicts(originalMessage,
- Arrays.asList(new String[] { "path1" }));
- assertEquals("Header Line\n\nCommit body\n\nConflicts:\n\tpath1\n",
+ List.of("path1"), '#');
+ assertEquals("Header Line\n\nCommit body\n\n# Conflicts:\n#\tpath1\n",
+ message);
+ }
+
+ @Test
+ public void testFormatWithConflictsCustomCharacter() {
+ String originalMessage = "Header Line\n\nCommit body";
+ String message = formatter.formatWithConflicts(originalMessage,
+ List.of("path1"), ';');
+ assertEquals("Header Line\n\nCommit body\n\n; Conflicts:\n;\tpath1\n",
message);
}
@@ -176,9 +186,9 @@ public class MergeMessageFormatterTest extends SampleDataRepositoryTestCase {
String originalMessage = "Header Line\n\nCommit body\n\nChangeId:"
+ " I123456789123456789123456789123456789\nBug:1234567\n";
String message = formatter.formatWithConflicts(originalMessage,
- Arrays.asList(new String[] { "path1" }));
+ List.of("path1"), '#');
assertEquals(
- "Header Line\n\nCommit body\n\nConflicts:\n\tpath1\n\n"
+ "Header Line\n\nCommit body\n\n# Conflicts:\n#\tpath1\n\n"
+ "ChangeId: I123456789123456789123456789123456789\nBug:1234567\n",
message);
}
@@ -188,9 +198,9 @@ public class MergeMessageFormatterTest extends SampleDataRepositoryTestCase {
String originalMessage = "Header Line\n\nCommit body\nBug:1234567\nMore Body\n\nChangeId:"
+ " I123456789123456789123456789123456789\nBug:1234567\n";
String message = formatter.formatWithConflicts(originalMessage,
- Arrays.asList(new String[] { "path1" }));
+ List.of("path1"), '#');
assertEquals(
- "Header Line\n\nCommit body\nBug:1234567\nMore Body\n\nConflicts:\n\tpath1\n\n"
+ "Header Line\n\nCommit body\nBug:1234567\nMore Body\n\n# Conflicts:\n#\tpath1\n\n"
+ "ChangeId: I123456789123456789123456789123456789\nBug:1234567\n",
message);
}