From b8e763fc19fd20d1c846bf538532907cf542ce46 Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Thu, 2 May 2013 23:07:04 +0200 Subject: 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 --- .../tst/org/eclipse/jgit/api/TagCommandTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit.test/tst') 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 + * Copyright (C) 2010, 2013 Chris Aniszczyk * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -80,6 +80,18 @@ public class TagCommandTest extends RepositoryTestCase { assertEquals(commit.getId(), db.peel(tagRef).getPeeledObjectId()); } + @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); -- cgit v1.2.3