summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2014-03-03 18:10:44 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2014-03-03 18:10:44 -0500
commitb640e3ab319ca6bf4310d2a1e681e4a08f5ddd50 (patch)
treec2d6ef5a0902a05f62db87032b65a7afd3db51db /org.eclipse.jgit.test/tst
parent1328bfdfeb0b401d2e15e32c605515e1ea02216b (diff)
parentc096b42e3e6714f3df3dec317cf1826c43734eb1 (diff)
downloadjgit-b640e3ab319ca6bf4310d2a1e681e4a08f5ddd50.tar.gz
jgit-b640e3ab319ca6bf4310d2a1e681e4a08f5ddd50.zip
Merge "Add setContains to ListBranchCommand (branch --contains)"
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
index 91ced0a596..c0e2e2ca8a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
@@ -197,6 +197,20 @@ public class BranchCommandTest extends RepositoryTestCase {
}
@Test
+ public void testListBranchesWithContains() throws Exception {
+ git.branchCreate().setName("foo").setStartPoint(secondCommit).call();
+
+ List<Ref> refs = git.branchList().call();
+ assertEquals(2, refs.size());
+
+ List<Ref> refsContainingSecond = git.branchList()
+ .setContains(secondCommit.name()).call();
+ assertEquals(1, refsContainingSecond.size());
+ // master is on initial commit, so it should not be returned
+ assertEquals("refs/heads/foo", refsContainingSecond.get(0).getName());
+ }
+
+ @Test
public void testCreateFromCommit() throws Exception {
Ref branch = git.branchCreate().setName("FromInitial").setStartPoint(
initialCommit).call();