summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorChris Aniszczyk <caniszczyk@gmail.com>2011-03-15 09:57:32 -0400
committerCode Review <codereview-daemon@eclipse.org>2011-03-15 09:57:32 -0400
commited2a8b5acfffba36b19738f313c2c1758ebf44bf (patch)
tree893dc74d9117136d971c514ed3ebb2409493b7c0 /org.eclipse.jgit.test/tst
parent79ad15924acc2ba2412d5114c85db27f0f4aca22 (diff)
parent92078473aabc7f6120b12447cb5aab9986d65246 (diff)
downloadjgit-ed2a8b5acfffba36b19738f313c2c1758ebf44bf.tar.gz
jgit-ed2a8b5acfffba36b19738f313c2c1758ebf44bf.zip
Merge "CloneCommand: add a test to ensure we fetch all tags"
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
index eb671a2899..51ae054da3 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
@@ -49,17 +49,25 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
+import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.RefUpdate;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.revwalk.RevBlob;
import org.junit.Test;
public class CloneCommandTest extends RepositoryTestCase {
private Git git;
+ private TestRepository<Repository> tr;
+
public void setUp() throws Exception {
super.setUp();
+ tr = new TestRepository<Repository>(db);
+
git = new Git(db);
// commit something
writeTrashFile("Test.txt", "Hello world");
@@ -75,6 +83,8 @@ public class CloneCommandTest extends RepositoryTestCase {
writeTrashFile("Test.txt", "Some change");
git.add().addFilepattern("Test.txt").call();
git.commit().setMessage("Second commit").call();
+ RevBlob blob = tr.blob("blob-not-in-master-branch");
+ git.tag().setName("tag-for-blob").setObjectId(blob).call();
}
@Test
@@ -87,6 +97,8 @@ public class CloneCommandTest extends RepositoryTestCase {
+ git.getRepository().getWorkTree().getPath());
Git git2 = command.call();
assertNotNull(git2);
+ ObjectId id = git2.getRepository().resolve("tag-for-blob");
+ assertNotNull(id);
} catch (Exception e) {
fail(e.getMessage());
}