summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-05-02 23:07:04 +0200
committerRobin Stocker <robin@nibor.org>2013-05-03 15:36:27 +0200
commitb8e763fc19fd20d1c846bf538532907cf542ce46 (patch)
treed44cc8c039948002208b02c63862adc34708ed73 /org.eclipse.jgit.test/tst
parente8f720335f86198d4dc99af10ffb6f52e40ba06f (diff)
downloadjgit-b8e763fc19fd20d1c846bf538532907cf542ce46.tar.gz
jgit-b8e763fc19fd20d1c846bf538532907cf542ce46.zip
TagCommand should be able to create unannotated tags too
Using the low level API's is just too cumbersome. Change-Id: Id5b9f560ee095d6db0b2ea5b26aef3e53021626e Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java14
1 files changed, 13 insertions, 1 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 b9838b1712..061d29f502 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, Chris Aniszczyk <caniszczyk@gmail.com>
+ * Copyright (C) 2010, 2013 Chris Aniszczyk <caniszczyk@gmail.com>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -81,6 +81,18 @@ public class TagCommandTest extends RepositoryTestCase {
}
@Test
+ public void testUnannotatedTagging() throws GitAPIException,
+ JGitInternalException {
+ Git git = new Git(db);
+ git.commit().setMessage("initial commit").call();
+ RevCommit commit = git.commit().setMessage("second commit").call();
+ git.commit().setMessage("third commit").call();
+ Ref tagRef = git.tag().setObjectId(commit).setName("tag")
+ .setAnnotated(false).call();
+ assertEquals(commit.getId(), tagRef.getObjectId());
+ }
+
+ @Test
public void testEmptyTagName() throws GitAPIException {
Git git = new Git(db);
git.commit().setMessage("initial commit").call();