aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2013-03-13 11:05:19 -0700
committerDave Borowitz <dborowitz@google.com>2013-03-13 12:28:58 -0700
commitd2a6c4b95504269b72f749a674be138fb5ecc5da (patch)
treecdc6f30863d716a2e813d8fca593b233707c29d4 /org.eclipse.jgit.test/tst/org/eclipse
parente175daf123f67e31f85466be595810bbfccc08e1 (diff)
downloadjgit-d2a6c4b95504269b72f749a674be138fb5ecc5da.tar.gz
jgit-d2a6c4b95504269b72f749a674be138fb5ecc5da.zip
Allow adding single refs or all tags to NameRevCommand
Change-Id: I90e85bc835d11278631afd0e801425a292578bba
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java20
1 files changed, 20 insertions, 0 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 82839e3bc1..f67d669316 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
@@ -89,6 +89,26 @@ public class NameRevCommandTest extends RepositoryTestCase {
}
@Test
+ public void ref() throws Exception {
+ RevCommit c = tr.commit().create();
+ tr.update("refs/heads/master", c);
+ tr.update("refs/tags/tag", c);
+ assertOneResult("master",
+ git.nameRev().addRef(db.getRef("refs/heads/master")), c);
+ assertOneResult("tag",
+ git.nameRev().addRef(db.getRef("refs/tags/tag")), c);
+ }
+
+ @Test
+ public void annotatedTags() throws Exception {
+ RevCommit c = tr.commit().create();
+ tr.update("refs/heads/master", c);
+ tr.update("refs/tags/tag1", c);
+ tr.update("refs/tags/tag2", tr.tag("tag2", c));
+ assertOneResult("tag2", git.nameRev().addAnnotatedTags(), c);
+ }
+
+ @Test
public void simpleAncestor() throws Exception {
// 0--1--2
RevCommit c0 = tr.commit().create();