summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/tst
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeTest.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeTest.java
index 28a107bcb1..d0b363baa9 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/MergeTest.java
@@ -102,6 +102,40 @@ public class MergeTest extends CLIRepositoryTestCase {
}
@Test
+ public void testMergeNoCommit() throws Exception {
+ git.branchCreate().setName("side").call();
+ writeTrashFile("master", "content");
+ git.add().addFilepattern("master").call();
+ git.commit().setMessage("master commit").call();
+ git.checkout().setName("side").call();
+ writeTrashFile("side", "content");
+ git.add().addFilepattern("side").call();
+ git.commit().setMessage("side commit").call();
+
+ assertEquals(
+ "Automatic merge went well; stopped before committing as requested",
+ execute("git merge --no-commit master")[0]);
+ }
+
+ @Test
+ public void testMergeNoCommitSquash() throws Exception {
+ git.branchCreate().setName("side").call();
+ writeTrashFile("master", "content");
+ git.add().addFilepattern("master").call();
+ git.commit().setMessage("master commit").call();
+ git.checkout().setName("side").call();
+ writeTrashFile("side", "content");
+ git.add().addFilepattern("side").call();
+ git.commit().setMessage("side commit").call();
+
+ assertArrayEquals(
+ new String[] {
+ "Squash commit -- not updating HEAD",
+ "Automatic merge went well; stopped before committing as requested",
+ "" }, execute("git merge --no-commit --squash master"));
+ }
+
+ @Test
public void testSquash() throws Exception {
git.branchCreate().setName("side").call();
writeTrashFile("file1", "content1");