diff options
author | Ketan Padegaonkar <KetanPadegaonkar@gmail.com> | 2011-05-23 12:06:52 +0530 |
---|---|---|
committer | Chris Aniszczyk <zx@twitter.com> | 2011-08-21 13:43:50 -0700 |
commit | e38cf2078d22e2c902a373371382ac8d82268f2d (patch) | |
tree | c41f48f7ce96b6c8c45edd1aad665a0e8853d454 /org.eclipse.jgit.test | |
parent | bd691f162c32cd9e9834e1d8a2baef99c4eac09b (diff) | |
download | jgit-e38cf2078d22e2c902a373371382ac8d82268f2d.tar.gz jgit-e38cf2078d22e2c902a373371382ac8d82268f2d.zip |
Add ListTagCommand to JGit API
Bug: 355246
Change-Id: I11e019f3c19b4340ac7160ac8fcbadd52499d322
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java index 1db0381d0b..1e8f7fde01 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java @@ -197,4 +197,40 @@ public class TagCommandTest extends RepositoryTestCase { assertEquals(0, deleted.size()); } + @Test + public void testShouldNotBlowUpIfThereAreNoTagsInRepository() + throws Exception { + Git git = new Git(db); + git.add().addFilepattern("*").call(); + git.commit().setMessage("initial commit").call(); + List<RevTag> list = git.tagList().call(); + assertEquals(0, list.size()); + } + + @Test + public void testShouldNotBlowUpIfThereAreNoCommitsInRepository() + throws Exception { + Git git = new Git(db); + List<RevTag> list = git.tagList().call(); + assertEquals(0, list.size()); + } + + @Test + public void testListAllTagsInRepositoryInOrder() throws Exception { + Git git = new Git(db); + git.add().addFilepattern("*").call(); + git.commit().setMessage("initial commit").call(); + + git.tag().setName("v3").call(); + git.tag().setName("v2").call(); + git.tag().setName("v10").call(); + + List<RevTag> list = git.tagList().call(); + + assertEquals(3, list.size()); + assertEquals("v10", list.get(0).getTagName()); + assertEquals("v2", list.get(1).getTagName()); + assertEquals("v3", list.get(2).getTagName()); + } + } |