diff options
author | Dave Borowitz <dborowitz@google.com> | 2013-03-13 11:05:19 -0700 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2013-03-13 12:28:58 -0700 |
commit | d2a6c4b95504269b72f749a674be138fb5ecc5da (patch) | |
tree | cdc6f30863d716a2e813d8fca593b233707c29d4 /org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java | |
parent | e175daf123f67e31f85466be595810bbfccc08e1 (diff) | |
download | jgit-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/jgit/api/NameRevCommandTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java | 20 |
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(); |