summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2013-03-14 09:35:00 -0700
committerDave Borowitz <dborowitz@google.com>2013-03-14 09:35:00 -0700
commit8e2a24a3b636d22a973e89763b5dbf11ec0d6821 (patch)
tree7e508c28e0582541eea1c807e4179c075e0667a4 /org.eclipse.jgit.test
parentd2a6c4b95504269b72f749a674be138fb5ecc5da (diff)
downloadjgit-8e2a24a3b636d22a973e89763b5dbf11ec0d6821.tar.gz
jgit-8e2a24a3b636d22a973e89763b5dbf11ec0d6821.zip
NameRevCommand: Use ~ notation for first parents of merges
Prefer ~(N+1) to ^1~N. Although both are correct, the former is cleaner and matches "git name-rev". Change-Id: I772001a219e5eb346f5552c92e6d98c70b2cfa98
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
index f67d669316..26dc2d05a6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
@@ -144,7 +144,21 @@ public class NameRevCommandTest extends RepositoryTestCase {
RevCommit c2 = tr.commit().parent(c0).create();
RevCommit c3 = tr.commit().parent(c1).parent(c2).create();
tr.update("master", c3);
- assertOneResult("master^1~1", c0);
+ assertOneResult("master~2", c0);
+ }
+
+ @Test
+ public void onePathMergeSecondParent() throws Exception {
+ // 0--1-----4
+ // \-2--3-/
+ RevCommit c0 = tr.commit().create();
+ RevCommit c1 = tr.commit().parent(c0).create();
+ RevCommit c2 = tr.commit().parent(c0).create();
+ RevCommit c3 = tr.commit().parent(c2).create();
+ RevCommit c4 = tr.commit().parent(c1).parent(c3).create();
+ tr.update("master", c4);
+ assertOneResult("master^2", c3);
+ assertOneResult("master^2~1", c2);
}
@Test