|
|
@ -57,7 +57,9 @@ public class BranchTest extends CLIRepositoryTestCase { |
|
|
|
@Before |
|
|
|
@Before |
|
|
|
public void setUp() throws Exception { |
|
|
|
public void setUp() throws Exception { |
|
|
|
super.setUp(); |
|
|
|
super.setUp(); |
|
|
|
new Git(db).commit().setMessage("initial commit").call(); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
|
|
|
|
git.commit().setMessage("initial commit").call(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -77,14 +79,16 @@ public class BranchTest extends CLIRepositoryTestCase { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testListContains() throws Exception { |
|
|
|
public void testListContains() throws Exception { |
|
|
|
new Git(db).branchCreate().setName("initial").call(); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
RevCommit second = new Git(db).commit().setMessage("second commit") |
|
|
|
git.branchCreate().setName("initial").call(); |
|
|
|
|
|
|
|
RevCommit second = git.commit().setMessage("second commit") |
|
|
|
.call(); |
|
|
|
.call(); |
|
|
|
assertArrayOfLinesEquals(new String[] { " initial", "* master", "" }, |
|
|
|
assertArrayOfLinesEquals(new String[] { " initial", "* master", "" }, |
|
|
|
execute("git branch --contains 6fd41be")); |
|
|
|
execute("git branch --contains 6fd41be")); |
|
|
|
assertArrayOfLinesEquals(new String[] { "* master", "" }, |
|
|
|
assertArrayOfLinesEquals(new String[] { "* master", "" }, |
|
|
|
execute("git branch --contains " + second.name())); |
|
|
|
execute("git branch --contains " + second.name())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testExistingBranch() throws Exception { |
|
|
|
public void testExistingBranch() throws Exception { |
|
|
|